file = pd.read_csv('xxx.csv', engine='python')
# iterrows 读取每一行
for index, row in file.iterrows():
# row['xxx'] xxx为你要搜索的列名
# 'yyy' yyy为你要搜索的关键字
if row['xxx'] == 'yyy':
print(row)
pandas 读取csv 根据列属性值获取指定行
最新推荐文章于 2024-03-04 12:24:58 发布