-
Notifications
You must be signed in to change notification settings - Fork 76
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
Inconsistent header treatment for csv tables #29
Comments
AndydeCleyre
added a commit
to AndydeCleyre/zpy
that referenced
this issue
Feb 17, 2022
It’s a heuristic used by the Python CSV library, which is imperfect as you have noticed. In the future I’ll expose a way to adjust the via an option. |
Thanks! Do you know what about the input in this case gives |
Not sure. You could have a look at the source of the csv module. |
FYI:
def has_header(self, sample):
# Creates a dictionary of types of data in each column. If any
# column is of a single type (say, integers), *except* for the first
# row, then the first row is presumed to be labels. If the type
# can't be determined, it is assumed to be a string in which case
# the length of the string is the determining factor: if all of the
# rows except for the first are the same length, it's a header.
# Finally, a 'vote' is taken at the end for each column, adding or
# subtracting from the likelihood of the first row being a header.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello!
I'm sorry I'm not sure exactly what's going on here, so I'll get to it. Using Zsh:
Same result as above
What determines whether the first row gets treated as a header?
Thanks for any help!
The text was updated successfully, but these errors were encountered: