如何对pandas dataframe的行做循环?类似于
for row in rows:
do_something
3个回答
df = pd.DataFrame(np.random.randn(5, 3), columns=list('ABC'))
for index, row in df.iterrows():
print(row['A'], row['B'],row['C'])
如何对pandas dataframe的行做循环?类似于
for row in rows:
do_something
df = pd.DataFrame(np.random.randn(5, 3), columns=list('ABC'))
for index, row in df.iterrows():
print(row['A'], row['B'],row['C'])