Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Selecting first and last row in python
Post: RE: Selecting first and last row in python

My code: def test(x): if((df.groupby(['city']).first())== (df.groupby(['city']).last())): df["NEW"]=1 return x df
sudhirkaukuntla Data Science 2 2,489 Oct-01-2019, 06:12 AM
    Thread: Selecting first and last row in python
Post: Selecting first and last row in python

Hi All, Im trying to compare first and last value in pandas dataframe. My requirement is if first value of column(id) group by city = last value of column(id) group by city, then create new field NE...
sudhirkaukuntla Data Science 2 2,489 Sep-30-2019, 02:39 PM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020