Reputation: 326
I have been looking this site and google for an answer to my question, but they all apply to columns.
In my data set there are a couple of cells which only contain a space, instead of NaN. So I would like to drop all the rows there this is the case. I know I can use the code below to do so per column. But how do I apply this to the entire dataframe?
df= df[df.column != ' ']
Upvotes: 0
Views: 44
Reputation: 862396
If need remove all rows with space at least in one column add DataFrame.all
for test if all values per rows are True
s:
df= df[(df != ' ').all(axis=1)]
Upvotes: 3