简体   繁体   中英

Accessing elements in panda dataframe

How do I iterate through this dataframe? I want to know what the nameis (AAL, AAME, or AACG) and be able to access the everything highlighted in red for name.

熊猫股票数据框

You are trying to access the multi-index column. Accessing a multi-index column is pretty the same as the access a column in the general dataFrame. For example, if you want to access 2020-05-21 row in AAL then you have to...

df['AAL']['Date']['2020-05-21']

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