Skip to content
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

io.ascii.read no longer automatically recognizes tables in fixed_width_twoline format #5398

Open
kslong opened this issue Oct 7, 2016 · 6 comments
Labels

Comments

@kslong
Copy link

kslong commented Oct 7, 2016

In the past, that is pre u'1.2.dev15800, one could write an asciii table in fixed_width_two_line and then read it back (allowing the routine to guess the format), but now when you do this (possibly only when the columns are strings) it is interpreting the second line in the table (the line containing ---) as values in the columns.

A short program and the data I was using are below:

I had thought that fixed_width_two_line was one of the formats that ascii.read was guaranteed to recognize (which was the reason I had selected it as my default output style), and so am surprised that this feature has apparently been "lost". As far as I remember that is how the old documentation read.

The new documentaion now appears to prefer a more basic format, but it seems like this would be an easy problem to fix, since a fixed-header is the only one that would have a line with all --

@pllim pllim added the io.ascii label Oct 7, 2016
@pllim
Copy link
Member

pllim commented Oct 7, 2016

I remember reading some comment from @taldcroft that setting guess=False can fix some parsing problems. Not sure if it applies to your case, but you can give it a try. Also, by "now", which version number are you referring to?

@kslong
Copy link
Author

kslong commented Oct 7, 2016 via email

@pllim
Copy link
Member

pllim commented Oct 7, 2016

It is 1.3.dev... now. Have you tried with the latest dev?

@kslong
Copy link
Author

kslong commented Oct 7, 2016

No, I have not tried 1.3.dev

@taldcroft
Copy link
Member

The problem here is that your table file only has one column. One of the rules for guessing a format is that it must have at least two columns. For some formats you can get false positives if you allow an output with just one column. I.e. Think about comma separated where you try to read with space delimited.

@kslong
Copy link
Author

kslong commented Oct 7, 2016 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants