Copy filtered data back to same data frame in Python
Answer is:
df.reset_index(drop=True, inplace=True)
Thanks Sarath Gadde for the hint!
I want to filter dataframe and copy back the result to the same dataframe. Basically want to ignore all rows which doesn't fit my criteria.
df = df[df.temperature>30]  #I only want data/rows with temperature column above 30.
When I print df I get desired result but I get following error when I further work on the df.
Exception has occurred: KeyError
0