Closed
Description
xref #16079 (adding lowercase n/a
to default missing values) - I have a case where I want to treat 'n/a'
as non-missing, but keep the rest of the default behavior. It seems this is about the best I can do, which involves an internal value.
from io import StringIO
data = '''a,b
1,2
3,n/a'''
pd.read_csv(StringIO(data),
na_values=pd.io.common._NA_VALUES.difference(['n/a']),
keep_default_na=False)
Not suggesting reverting #16079, but wonder if if there might be a better way to expose through some kind of option? Initial idea was something like pd.options.na_values
(set to the current _NA_VALUES
), though might be issues using a mutable value as an option. Also could expose something like pd.io.DEFAULT_NA_VALUES