question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pandas.read_excel index_col argument behavior seems to be wrong (or unexpected, as by the docs)

See original GitHub issue

http://pandas.pydata.org/pandas-docs/stable/generated/pandas.read_excel.html#pandas.read_excel

It’s about the parameter index_col.

From the docs, I read

index_col : int, list of ints, default None

    Column (0-indexed) to use as the row labels of the DataFrame. Pass None if there is no such column. If a list is passed, those columns will be combined into a MultiIndex"

I use the function with args={index_col=3, parse_cols=“D-J”} (so it should parse from column 3 to column 9 included, 0-indexed). And I expected D to be used as Index, but actually it was column G. I am not sure if it is the expected behavior, if then, maybe argument order should be changed to show that index_col depends on parsed_cols.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
chris-b1commented, Jun 6, 2017
0reactions
rosyguptacommented, Jun 6, 2017

@chris-b1 I shall work on it. But I’m more interested in some coding issue. Could you suggest some for starters?

Read more comments on GitHub >

github_iconTop Results From Across the Web

read_excel surprisingly filling empty levels in MultiIndex ...
This behavior was introduced in #10967. pandas is forward filling index columns under the assumption that the excel sheet was written from a...
Read more >
pandas.read_excel — pandas 0.24.0rc1 documentation
If a list is passed, those columns will be combined into a MultiIndex . If a subset of data is selected with usecols...
Read more >
python - panda read_excel index_col seems to skip a row
I am trying to get a multi level index and column pandas data frame from an excel file, but oddly it ...
Read more >
Pandas read_excel() - Reading Excel File in Python
The sheet_name parameter defines the sheet to be read from the excel file. When we print the DataFrame object, the output is a...
Read more >
Pandas - read_excel() - How to read Excel file in python
To do that we need to pass the sheet name to the sheet_name parameter in pandas. df = pd.read_excel('reading_excel_file.xlsx', sheet_name=' ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found