0

I have an excel file. In row 1 (A:I) are text values, which I want to be the headers of my dataframe. In row 2 (A:I) are CIQRANGE functions which I want to be ignored when converting to dataframe. In rows 3:1425 are the values; column A has dates and columns B:I have numbers.

No matter how I structure read_excel I get an empty dataframe with 9 very odd and long text column names that I think represent the CIQRANGE functions in row 2. skiprows doesn't seem to have an effect.

What I think should work:

priceHistory = pd.read_excel('file.xlsx', header=0, skiprows=[1], sheetname=1)
slothish1
  • 119
  • 1
  • 11
  • Maybe share the original Excel file somehow? A bit hard to replicate what is wrong without the file. – Evgeny Aug 28 '19 at 18:28

1 Answers1

0

Are you sure about sheetname=1? If you have one sheet this argument should be omitted, None or 0.

sheet_name : str, int, list, or None, default 0 Available cases:

Defaults to 0: 1st sheet as a DataFrame

Evgeny
  • 4,173
  • 2
  • 19
  • 39
  • Yes, the first sheet is not what I want to be read; target information is on the second sheet. – slothish1 Aug 28 '19 at 18:44
  • Pelase see the comment above - hard to imagine what is wrong without the file. Looks like the values not computed before reading the file. See some clues here: https://stackoverflow.com/questions/41722374/pandas-read-excel-values-not-formulas – Evgeny Aug 28 '19 at 18:58