简体   繁体   中英

Pandas read_excel skiprows on Capital IQ series?

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)

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM