Reputation: 114
I mean in a csv file, maybe some column of some line is null, I want to get the lines with any of its item is null. For example,
Name Age Sex
Tom 12 M
Anna 21 F
Andy 31
Monna F
Then Andy and Monna has some value which is null, and I want them.
Upvotes: 0
Views: 468
Reputation: 111
Dataframe has method isnull:
import pandas as pd
df = pd.read_csv(//your file)
df = df[df.isnull().any(axis=1)]
Upvotes: 2