i am new to pandas. I have loaded csv using pandas.read_csv. i have tried not to specify dtype but it was way too slow. since it is a very large file, i also specified data
From the pd.read_csv docs:
na_values
: scalar,str
,list
-like, ordict
, defaultNone
Additional strings to recognize as
NA
/NaN
. Ifdict
passed, specific per-column NA values. By default the following values are interpreted as NaN: ‘’, ... ‘NA’, ...`.
Bold emphasis mine. These values are not tossed away, rather, they are converted to NaN
. Pandas is smart enough to automatically recognise those values without you explicitly stating it.