0

I would like to drop two problematic lines into the dataframe but it gives me an error. (I guess it is very simple but my level of programming is very very low)

Code :

import pandas as pd
members = pd.read_csv("https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-09-22/members.csv")

The error :

members = members.drop(members[(members["injury_height_metres"]>8850)])

1 Answer 1

1

You need to pass the index when dropping rows:

members = members.drop(members[(members["injury_height_metres"]>8850)].index)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.