当年写的,哈哈哈,真简单,实际没学一样,当我遇到实际问题,还是不会
import pandas as pd
df = pd.DataFrame({'A': [1, 2], 'B': [3, 4]})for index, row in df.iterrows(): print('index:',index) print('A:',row['A'])
对整行进行遍历
对某列进行遍历