当我们使用时:
for index, row in df.iterrows():
# prints tuple (column, value)
print(row)
# prints column name (left side)
print (row.index)
我们如何只打印值(元组的右侧?)
答案 0 :(得分:2)
for index, row in df.iterrows():
# prints tuple (column, value)
print(row.values)
# prints column name (left side)
print (row.index.values)