My code:
def test(x): if((df.groupby(['city']).first())== (df.groupby(['city']).last())): df["NEW"]=1 return x df
Selecting first and last row in python
|
|
Messages In This Thread |
Selecting first and last row in python - by sudhirkaukuntla - Sep-30-2019, 02:39 PM
RE: Selecting first and last row in python - by Larz60+ - Sep-30-2019, 03:17 PM
RE: Selecting first and last row in python - by sudhirkaukuntla - Oct-01-2019, 06:12 AM
|