0

Hi I am trying to drop a row from a Data frame, loaded from a CSV file:

no_show_raw_data = pd.read_csv("noshowappointments.csv")

df = no_show_raw_data

new_df = df[df.No-show != 'No']

but i get this error:

AttributeError: 'DataFrame' object has no attribute 'No'

0

1 Answer 1

1

The columns No-show has a minus sign in the name, try brackets instead:

no_show_raw_data = pd.read_csv("noshowappointments.csv")

df = no_show_raw_data

new_df = df[df['No-show'] != 'No']
Sign up to request clarification or add additional context in comments.

1 Comment

If it worked for you, please mark this question as solved, so it's no longer open.

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.