![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
pandas
live high,high live
这个作者很懒,什么都没留下…
展开
-
The kernel appears to have died. It will restart automatically
网上查了很多,大多是调用某第三方包时报错,这时更新这个包。但是我的情况不是前者,于是推测还是因为数据量太多,机器跑步下了。尽管我前几天都能跑,但现在内存31.5G,每次还剩3G左右的时候报错。减少数据量,果然就不会出现该报错。...原创 2021-07-29 17:36:44 · 309 阅读 · 0 评论 -
pandas.errors.ParserError: Error tokenizing data. C error: EOF inside string starting at line..
pd.read_csv时报错:pandas.errors.ParserError: Error tokenizing data. C error: EOF inside string starting at line …我一般出现这种错误的原因是:将文件从服务器下载到网络,中途断网或者网络不好,重新下载文件后恢复正常...原创 2020-12-16 15:04:41 · 883 阅读 · 1 评论 -
判断dataframe中某字段是否包含nan值
判断dataframe字段是否包含空值时,要用isnull(),不能用np.nan():df[df['col_name'].isnull()] --正确df[df['col_name']==np.nan] --错误np.nan == np.nan - 输出False原创 2020-11-08 11:45:19 · 3827 阅读 · 0 评论 -
pandas.dataframe筛选含有空值的数据行
筛选非空的数据行:import pandas as pd#返回指定单列中没有空值的数据行df[pd.notnull(df[col])]df[df[col].notnull()]#指定多列 #返回指定多列/df全部列中满足任意一列没有空值的数据行df[df[[cols]].notnull().any(axis=1)] df[pd.notnull(df[[cols]]).any(axis=1)] #返回指定多列中/df全部列中满足所有列没有空值的数据行df[df[[cols]].notn.原创 2020-06-06 21:33:47 · 21088 阅读 · 2 评论