python - Is reading Excel data by column labels supported in pandas? -



python - Is reading Excel data by column labels supported in pandas? -

shows excel file i'm trying read from. shows want in non-legal code. shows have been trying far.

1) excel file

| b | c 1 name1 name2 name3 2 33 44 55 3 23 66 77 4 22 33 99

2) non-legal code:

frame = pd.read_excel(path, 'sheet1', parse_cols="name1,name2,name3")

in illustration can assume column names unique.

3) tried far:

what have been trying far utilize parse_cols, don't think i'm trying supported pandas.

per the documentation, there no back upwards trying do. can select columns column number or column name, not column label:

parse_cols : int or list, default none

if none parse columns,

if int indicates lastly column parsed

if list of ints indicates list of column numbers parsed

if string indicates comma separated list of column names , column ranges (e.g. “a:e” or “a,c,e:f”)

python excel pandas

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -