You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
The docstring and online manual for
read_fwf()
say:But in fact,
sep
does nothing in this function, whiledelimiter
has some effect, though perhaps not intentional:Both are nonsensical and should really produce an error, but they actually produce two different results:
The documentation should be cleaned up to not suggest the use of
delimiter
withread_fwf()
unless it is actually useful and intended (in which casesep
should be made to do the same, and documented).Discovered by https://stackoverflow.com/questions/45257881/python-transform-string-into-dataframe-using-tab-as-separator/
Pandas 0.20: http://pandas.pydata.org/pandas-docs/version/0.20/generated/pandas.read_fwf.html
The text was updated successfully, but these errors were encountered: