One - One Code All

Blog Content

pandas中dataframe过滤列str.contain出现ValueError: cannot index with vector containing NA/NaN values错误的解决方法

Python 统计学-科学计算   2014-06-04 20:40:41

pandas中dataframe过滤列str.contain出现ValueError: cannot index with vector containing NA/NaN values错误的解决方法


df[df["ticker"].str.contains('0001',case=False, na=False)]

case是False是不区分大小写,而na=False是不是有NaN来填充缺失值。



上一篇:python 非线性规划(scipy.optimize.minimize)
下一篇:pandas中dataframe缺失值处理dropna和fillna,删除带有NAN的行或列

The minute you think of giving up, think of the reason why you held on so long.