-
Notifications
You must be signed in to change notification settings - Fork 145
Using select with explicit header names requires all the column names to be specified #701
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
Comments
select
with explicit header
names requires all the column names to be specified
Sorry for the slow response here; yes, I can see how this is a bit confusing, but when you provide the In general, I've grown to have the impression that we perhaps give too much weight to user-provided headers. If provided, we basically take that as absolute truth for the # of columns. Perhaps we need to rethink the approach here and have CSV.jl do more of it's own work around what's actually in the file, allowing |
Renaming columns while parsing is a feature I would definitely appreciate. |
I just encountered this issue. The main issue is the file I was reading used spaces as delimiters and in a text field, so the input columns was variable. But I just needed the first few. So I thought I could select the first few by index and then provide the column names. Nope! I got warnings about ignoring extra columns, which seemed fine; but I'm confused why it would drop rows. |
I've also just stumbled over the behaviour of CSV.jl that you have to give all header names, even if you only select a subset. That doesn't seem to me very useful. My typical use-case is, that I have files with quite a large number of columns, but I need only a few (say 100 cols and I need just 10). So I |
Consider the following example.
I find this rather surprising. I can either specify all the column names, which may be not too nice in a file with a large number of columns, or go with
header=0
and rename columns afterwards, which feels like an unnecessary step.The text was updated successfully, but these errors were encountered: