I'm trying to read a csv file which has 'NA' value as data. When I use the 'keep_default_na = false' option to keep NA values it's impacting other columns with empty rows.
The Data: csv pic
colA colB colC
'abc' , , NA
'ljk' , 10 , 'Paris'
'xyz' , 25 , NA
Here, I want to keep NA values in column 'colC'. I'm reading the csv like this.
DF = pandas.read_csv(csv, keep_default_na=False)
Now I can see NA values are being present in DF, but the values in the second column 'colB' are present as string ('10','25'), not as numbers.
This is happening if there is an empty row in a column with numeric values.
How can I apply 'keep_default_na= False' and still read other values in the same dType?
keep_default_na=False?