I am experiencing @shankarj67 's problem in imputing missing files .
As you correctly wrote, that is a warning, not an error. However, I get an error followed by that warning every time I impute a column with some NaN values.
Now, the problem I face is the following:
- I have tried to replace the NaN values with ’ '. This is the piece of code:
data = pd.read_csv("/path/train.csv", na_filter=False,index_col="Id")
When I check the number of empty values per column, I get 0. This is the code:
#Create a new function:
#Applying per column:
print("Missing values per column:")
This is the output:
Missing values per column:
As you can see, they are all zero now. And they weren’t before using
na_filter of course.
- NaN has been replaced BUT it seems that there are no more “empty cells”. Unfortunately, if I check the csv file, I still have missing values where once there were NaN. Indeed, if I write
This won’t change the csv file because the modified version apparently hasn’t got any missing values!
I can’t understand how to clean the csv getting rid of the NaN and leaving blank space so that this line of code
can return the real amount of missing value for each column.
Many Thanks for your help.