-1

I want to do the following:

index A1
0 1
1
2 -8
3 Hello
4

to:

index A1
1
4

Is there like a reverse .dropna function?

Petra Enis
  • 17
  • 4

1 Answers1

2

Assuming real NaNs:

out = df[df['A1'].isna()]

If empty strings:

out = df[df['A1'].eq('')]

For both:

out = df[df['A1'].fillna('').eq('')]
mozway
  • 194,879
  • 13
  • 39
  • 75