pandas 遍历 dataframe 行数据
import pandas as pd
inp = [{'c1':10, 'c2':100}, {'c1':11,'c2':110}, {'c1':12,'c2':120}]
df = pd.DataFrame(inp)
print(df)
# pandas 遍历 dataframe 行数据
for index, row in df.iterrows():
print(index,row[0],row[1],)
# pandas 遍历 dataframe 列数据
for x in df.loc[:,'c1']:
print(x)