Python Forum
Selecting first and last row in python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Selecting first and last row in python
#3
My code:

def test(x):
    if((df.groupby(['city']).first())== (df.groupby(['city']).last())):
        df["NEW"]=1
    return x
df
Reply


Messages In This Thread
RE: Selecting first and last row in python - by sudhirkaukuntla - Oct-01-2019, 06:12 AM

Forum Jump:

User Panel Messages

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