In my data set in height
column value increases then after starts to decrease. I want to sort data only up to increase height. I don't want data after height decrease.
You can achieve this by finding the index of the max value of the height
column, and then using iloc
to reassign the dataframe only including the rows up to this index:
x = df.idmax()['height']
df = df.iloc[:x+1]
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments