参考链接: 遍历Pandas DataFrame中的行和列
有如下 Pandas DataFrame:
import pandas as pd
inp = [{'c1':10, 'c2':100}, {...对于每一行,都希望能够通过列名访问对应的元素(单元格中的值)。...也就是说,需要类似如下的功能:
for row in df.rows:
print row['c1'], row['c2']
Pandas 可以这样做吗?...(c1=10, c2=100), Pandas(c1=11, c2=110), Pandas(c1=12, c2=120)]
全面的测试
我们测试了所有可用列:
def iterfullA(d):
...index=[10, 30, 100, 300, 1000, 3000, 10000, 30000],
columns='iterfullA iterfullB itersubA itersubB'.split