Closed AndydeCleyre closed 2 years ago
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 CSV
the wrong idea, so that I can work around this?
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.
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!