python - How to read specific rows from excel file using pandas -


i have excel file , need extract data rows of sheet. far have

import pandas pd xl_file = pd.excelfile((xlfilepath) dfs = {sheet_name: xl_file.parse(sheet_name) sheet_name in xl_file.sheet_names}  

now read numerical values found in particular row. row structure like:

length (mm) 10.1 - 16.0 - 19.5 - 16.4 - 11.3 

where attempting show in each cell of row. dashes indicate empty entry in cell! how can read in row using pandas library? happen know row number above row has there way pandas through data frame , find entry length (mm) instead of having specify row number?

edit: actual df.loc['length (mm)'] suggested edchum looks this:

0              17.92377 unnamed: 1          nan 0.05           18.55764 unnamed: 3          nan 0.1            19.17039 unnamed: 5          nan 0.15            19.7507 unnamed: 7          nan 0.2            20.29776 unnamed: 9          nan 0.25           20.80492 unnamed: 11         nan 0.3             21.2667 unnamed: 13         nan 0.35           21.67687 unnamed: 15         nan 0.4            22.02884 unnamed: 17         nan 0.45            22.3156 unnamed: 19         nan 0.5            22.53051 unnamed: 21         nan 0.55           22.66691 unnamed: 23         nan 0.6            22.71949 unnamed: 25         nan 0.65           22.68477 unnamed: 27         nan 0.7            22.56162 unnamed: 29         nan 0.75           22.35258 unnamed: 31         nan 0.8            22.06432 unnamed: 33         nan 0.85            21.7079 unnamed: 35         nan 0.9            21.29801 unnamed: 37         nan 0.95           20.85419 unnamed: 39         nan 1                20.394 name: length (mm), dtype: object 

after loading df can select specific row using label indexing loc:

df.loc['length (mm)'] 

if want np.array do:

df.loc['length (mm)'].values 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -