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
Would yield somewhat different and unexpected (in comparison with previous example) result:
A0 A0 C0 E0
A1 B1 C1 D1 E1
1 0004 0.1 1 a
2 0005 0.2 2 b
3 0006 0.3 3 c
Since it is not possible to use has_index_names=False as it has been depreciated since 0.16.2, there seems to be no way to have control over how pandas imports this first column (i.e. no way to convert values before original formatting is lost).
And there is no way to tell pandas DO_NOT_ASSIGN first column to index as it ignores index_col=None when header is a list.
So the question is what would be the sensible way to regain control over import process of first columns with multi-index header:
revive or de-depreciate (would that be appreciate?) has_index_names;
make index_col play a role in parsing header?
The text was updated successfully, but these errors were encountered:
Thanks for the report and detailed example - this is a duplicate of #11733. I'm entirely in favor of supporting this, though it is tricky to handle all the various formats and not break back-compat.
One idea I'm not sure I had explored - right now the default for index_col is None, so passing index_col=None can't give any information. We possibly could change the default to 'infer' (since that is what is really happening) - so that passing index_col=None is meaningful. PRs / additional ideas welcome!
Let's assume there are two excel files with almost identical content:
file_1.xlsx:
file_2.xlsx:
Then reading first file in pandas:
Would produce expected result:
However trying the same with the second file:
Would yield somewhat different and unexpected (in comparison with previous example) result:
Since it is not possible to use
has_index_names=False
as it has been depreciated since 0.16.2, there seems to be no way to have control over how pandas imports this first column (i.e. no way to convert values before original formatting is lost).And there is no way to tell pandas DO_NOT_ASSIGN first column to index as it ignores
index_col=None
whenheader
is a list.So the question is what would be the sensible way to regain control over import process of first columns with multi-index header:
has_index_names
;index_col
play a role in parsing header?The text was updated successfully, but these errors were encountered: