I have a csv-file with a column with strings and I want to read it with pandas. In this file the string null occurs as an actual value and should not be regarde
You can specify a converters argument for the string column.
pd.read_csv(StringIO(data), converters={'strings' : str})
strings numbers
0 foo 1
1 bar 2
2 null 3
This will by-pass pandas' automatic parsing.
Another option is setting na_filter=False:
pd.read_csv(StringIO(data), na_filter=False)
strings numbers
0 foo 1
1 bar 2
2 null 3
This works for the entire DataFrame, so use with caution. I recommend first option if you want to surgically apply this to select columns instead.