Closed
Description
The docstring and online manual for read_fwf()
say:
delimiter : str, default None
Alternative argument name for sep.
But in fact, sep
does nothing in this function, while delimiter
has some effect, though perhaps not intentional:
import io
import pandas as pd
pd.read_fwf(io.StringIO('foo,bar\n1,2'),delimiter=',')
pd.read_fwf(io.StringIO('foo,bar\n1,2'),sep=',')
Both are nonsensical and should really produce an error, but they actually produce two different results:
foo bar
0 1,2 NaN
foo,bar
0 1,2
The documentation should be cleaned up to not suggest the use of delimiter
with read_fwf()
unless it is actually useful and intended (in which case sep
should be made to do the same, and documented).