The following for everyone to share a Python solution pandas processing missing value is an empty string problem, has a good reference value, I hope to help you. Come and see it together.
Pit Record:
Use pandas to do CSV missing value processing time found strange bug, that is, Excel open CSV file, obviously there is nothing in the lattice, of course, I think with pandas Dropna () or Fillna () to deal with the missing values.
But pandas read the CSV file and found that empty place IsNull () unexpectedly is false, that is the place there is something ...
Later after the investigation found that nothing seems to have empty strings, so Pandas think there is no missing value, so you can not use Dropna () or Fillna () to deal with.
Solution: First use the regular to match the space, and then replace all the null, and then read the CSV with pandas to specify Read_csv (na_values= ' Null ') means that null is treated as Nan and can then be processed with Dropna () or Fillna ().
Above this python solve pandas processing missing value is empty string of the problem is small part to share all the content of everyone, hope to give you a reference, also hope that we support the script home.