You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you call read_csv and the length of names is larger than the number of columns in the data, extra column(s) containing only NaN will be added to the DataFrame created. I think that, generally, the extra name(s) is/are a sign of a bug in the program and/or input data that does not look as the user expects. In both cases, I think it could be helpful to issue a warning to make the user aware of the issue. Moreover, a warning may help avoiding future errors, for example if the user filters or merges data on the column containing only NaNs, thinking that it contains actual data.
Describe the solution you'd like
I think it would be helpful if read_csv issued a warning when the number of elements in names is larger than the number of columns in the data.
API breaking implications
If only a warning is issued, I don't see how this could break anything.
Describe alternatives you've considered
An alternative could be to issue an error instead of a warning.
The text was updated successfully, but these errors were encountered:
I don't find the other issues discussing this. The only one I find when searching is #38453, which discusses an inconsistency between the engines, but not whether to include the extra column or not. Would you mind pointing the other issues out?
Is your feature request related to a problem?
When you call
read_csv
and the length ofnames
is larger than the number of columns in the data, extra column(s) containing onlyNaN
will be added to the DataFrame created. I think that, generally, the extra name(s) is/are a sign of a bug in the program and/or input data that does not look as the user expects. In both cases, I think it could be helpful to issue a warning to make the user aware of the issue. Moreover, a warning may help avoiding future errors, for example if the user filters or merges data on the column containing onlyNaN
s, thinking that it contains actual data.Describe the solution you'd like
I think it would be helpful if
read_csv
issued a warning when the number of elements innames
is larger than the number of columns in the data.API breaking implications
If only a warning is issued, I don't see how this could break anything.
Describe alternatives you've considered
An alternative could be to issue an error instead of a warning.
The text was updated successfully, but these errors were encountered: