我想通过基于特定列中的值选择行来限制要打印的行。
例如:
Column1, Column2, Column3
aaa, bbb, ccc
none, ddd, ggg
我只想打印
Column1
值为none
的行。这是我的代码:
for v in df:
if 'none' in df['2nd_prize']:
print v
最佳答案
for row in table:
if row[0] is none:
print row