-1

How to drop rows which satisfies this condition:

df_covid_big_data.drop(df_covid_big_data['Confirmed'] < df_covid_big_data['Deaths'],axis=0,inplace=True)

Mayank Porwal
  • 33,470
  • 8
  • 37
  • 58
  • This looks like a standard `pandas` question, so removing tags `matplotlib , machine-learning, artificial-intelligence`. – Mayank Porwal May 13 '20 at 10:34

1 Answers1

0

You are very close, try this:

df_covid_big_data.drop(
    df_covid_big_data[
        df_covid_big_data['Confirmed'] < df_covid_big_data['Deaths']].index,
    inplace=True)

Wouldn't it be easier to just reverse the conditions?

df_covid_big_data[df_covid_big_data['Confirmed'] > df_covid_big_data['Deaths']]
Paweł Kowalski
  • 524
  • 3
  • 9