-
-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pd.read_fwf ignoring a space when reading space delimited file #23455
Comments
Can you rework your example so that it's valid code? (In any case if I try creating a sample file with the contents of temperature_lst I seem to get a correct result, so it may be that the file you're referencing is malformed.) |
Sorry, my bad tapped on close button by mistake. |
See http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports for writing examples. You should be able to use StringIO to make an example, no need for a separate text file. |
Thanks for that guys.
|
@paulvija The
This happens because the last row is now within 100. If you know your width, you can assign like
|
Closing, let us know if you think there's still something to be done @paulvija. |
Code Sample
Problem description
temperature_lst is a space delimited file, when using read_fwf to read this in to a dataframe some space is truncated in column 'v5'. This results in '-1.02' becoming just '1.02'.
Is this is a bug?
However, this works when 'widths' is defined. In my case, there are multiple files that are read in this way, so using 'widths' can be tedious.
The text was updated successfully, but these errors were encountered: