【发布时间】:2018-06-20 21:42:38
【问题描述】:
我有这个数据框 boroughCounts 和这些样本值:
From To Count
9 None Manhattan 302
10 Bronx Bronx 51
11 Bronx Manhattan 244
12 None Brooklyn 8
13 Bronx Queens 100
14 None None 67
尝试使用here 或here 所述的这种方法过滤“From”和“To”列中的None 值:
boroughCounts = boroughCounts[(boroughCounts.From != None) & (boroughCounts.To != None)]
boroughCounts = boroughCounts[(boroughCounts["From"] != None) & (boroughCounts["To"] != None)]
但它不起作用,所有值都保持原样。 是我用错了,还是有更好的方法?
【问题讨论】:
-
boroughCounts.info() 返回什么?