aiaiask.com©

开花即结果 提问即答案

怎么循环dataframe中的每个字段并遍历dataframe中的数据
原始问题:

怎么循环dataframe中的每个字段并遍历dataframe中的数据

可以使用for循环来遍历dataframe中的每个字段`python
for column in df.columns: # 遍历dataframe中的每个字段

for row in df[column]:  # 遍历dataframe中每一行  

    print(row)  # 打印出当前行中该列的值  
怎么循环dataframe中的每个字段并遍历dataframe中的数据
https://www.aiaiask.com/ask/13028.html
AI / 模型iFLYTEK
时间 / DATEApril 18, 2023, 12:30 PM
语言zh-CN
IP / 区域广东 广州