-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Allow file comments with genfromtxt(..., names=True) #351
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
Conversation
Ah. OK, so this change will not work with the following:
(using the table from test_commented_header). But it will work with any of the following:
etc. If this is an acceptable trade-off, I can rewrite the test. |
So it sounds like there's a behavioural change here, where before we required header names to have a comment marker at the beginning and now we require them not to? Or something like that? Discussions about what behaviour we want belong on numpy-discussion, because lots of people who might be affected don't read PRs, so you should send a note there explaining the issue. |
OK, will do. |
Discussion is at http://www.mail-archive.com/numpy-discussion@scipy.org/msg38306.html |
if names is True and comments in first_line: | ||
if skip_header == -1: | ||
first_line = first_line.split(comments)[0] | ||
else: | ||
first_line = asbytes('').join(first_line.split(comments)[1:]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI -- .split takes a second optional argument. All of these should just become first_line.split(comments, 1)
, and the join parts can just go away.
Ping the travisbot. |
I think this needs a test. @njsmith As you noted, this seems to change behavior. I don't recall the discussion about that or if anything was decided. |
A quick skim of that mailing list thread suggests that this change would break several people's code. I didn't read enough to see if a more generally acceptable solution was found. |
Sounds to me like it should be closed then. I don't know why travisbot it trying to install this in 2.4, but I've seen that in a few other spots. |
Going to close this. |
feat: Add vtst[q|d]_[s64|u64]
This fixes ticket #2184 (http://projects.scipy.org/numpy/ticket/2184).