首页 > 解决方案 > 将数据框解析为 Pandas 分析库时出现 TypeError

问题描述

我在对数据使用 pandas-profiling 时遇到 TypeError,如下所示:

汇总数据集:2% 1/59 [00:09<09:20, 9.66s/it, Describe variable:project] -->>

~\Anaconda3\lib\site-packages\pandas\core\algorithms.py in isin(comps, values)
    441         # If the the values include nan we need to check for nan explicitly
    442         # since np.nan it not equal to np.nan
--> 443         if np.isnan(values).any():
    444             f = lambda c, v: np.logical_or(np.in1d(c, v), np.isnan(c))
    445         else:

TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''

请帮忙。我不知道这是怎么回事。

标签: pythonpandasdataframedata-analysispandas-profiling

解决方案


自己解决了。查看 Pandas-Profiling Github 页面:

https://github.com/pandas-profiling/pandas-profiling/issues/752#issuecomment-815462226


推荐阅读