【发布时间】:2019-08-15 22:38:33
【问题描述】:
以下简单代码:
drop_cols = [col for col in train.columns if col[0] == 'V' and train[col].isnulll().sum()/len(train) > 0.76]
drop_cols
我收到此错误:
AttributeError Traceback(最近调用 最后)在() ----> 1 drop_cols = [col for col in train.columns if col[0] == 'V' and train[col].isnulll().sum()/len(train) > 0.76] 2个drop_cols
在 (.0) ----> 1 drop_cols = [col for col in train.columns if col[0] == 'V' and train[col].isnulll().sum()/len(train) > 0.76] 2个drop_cols
C:\Anaconda3\lib\site-packages\pandas\core\generic.py 在 getattr(self, name) 5065 if self._info_axis._can_hold_identifiers_and_holds_name(name): 5066
返回自我[姓名] -> 5067 返回对象。getattribute(self, name) 5068 5069 def setattr(self, name, value):AttributeError: 'Series' 对象没有属性 'isnulll'
isnull() 在其他地方工作。这是什么原因和解决方法?
【问题讨论】:
-
您的错误信息包含错字:
isnulll有 3 个小写 L。
标签: python pandas null list-comprehension