Closed
Description
>>> from pandas.compat import StringIO
>>> from pandas import read_csv
>>> data = 'a\nfoo\n1'
>>>
>>> read_csv(StringIO(data), na_values={0: 'foo'}, engine='c')
...
TypeError: Expected list, got set
>>> read_csv(StringIO(data), na_values={0: 'foo'}, engine='python')
a
0 foo # Should be NaN
1 1
This behaviour is slightly inconsistent with what we do with usecols
for example, so it would be nice to be able to process column indices with na_values
too.
xref #7119.