最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

關(guān)于pandas-profiling的降級之旅

 更新時間:2023年11月28日 11:01:13   作者:芊欣欲  
這篇文章主要介紹了關(guān)于pandas-profiling的降級之旅,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教

背景

做EDA分析,想要利用pandas-profling的集成工具,實現(xiàn)一鍵EDA自動化流程。

而pandas-profiling是python封裝好的庫,能夠使用DataFrame自動生成數(shù)據(jù)的詳細報告并能自動生成網(wǎng)頁進行可視化。

但理想和現(xiàn)實總是有差距,這個過程出現(xiàn)了很多error,主要原因都是由pandas-profiling的版本與環(huán)境不兼容導致的,謹以此文記入這些error和解決辦法供大家參考。

[Pandas-profiling] ImportError: cannot import name ‘ABCIndexClass’ from ‘pandas.core.dtypes.generic’

這是在安裝后的第一個報錯,發(fā)生于import pandas語句。

經(jīng)過調(diào)研,發(fā)現(xiàn)該問題是由于pip安裝時,會安裝pandas-profiling的最新版,但是:

Pandas v1.3 renamed the ABCIndexClass to ABCIndex.

The visions dependency of the pandas-profiling package hasn’t caught up yet, and so throws an error when it can’t find ABCIndexClass.

即pandas已經(jīng)升級了,但是pandas-profiling并沒升級,它們兩個中的同一個類有不同的類名對不上,所以出現(xiàn)了這個報錯。

解決辦法

Downgrading pandas to the 1.2.x series will resolve the issue.

我重新安裝了1.2.0版本的pandas-profiling包

module ‘pandas.core.common’ has no attribute ‘is_numeric_dtype’

這個時候import pandas-profiling不會再出現(xiàn)報錯了,可是report=ProfilieReport(df)這一步時會出現(xiàn)新的報錯。

經(jīng)過調(diào)研,發(fā)現(xiàn)該問題是由于:

pandas.core.common.is_numeric_dtype was removed in 0.23.

總的來說還是pandas的版本太高了,有兩種解決辦法:

  • 一種就是降低pandas的等級至0.22
  • 另一種就是自己重新配置一下pandas(不建議)。

代碼

from pandas_profiling import ProfileReport
report=ProfileReport(df)
report.to_file(output_file='output.html')

總結(jié)

以上為個人經(jīng)驗,希望能給大家一個參考,也希望大家多多支持腳本之家。

相關(guān)文章

最新評論

饶阳县| 沙湾县| 化州市| 洪雅县| 高安市| 万全县| 秀山| 英德市| 滁州市| 云龙县| 江西省| 通渭县| 佛学| 留坝县| 忻州市| 曲阳县| 铜梁县| 加查县| 霍山县| 凭祥市| 灵璧县| 延庆县| 二连浩特市| 磴口县| 齐齐哈尔市| 平昌县| 永安市| 宁强县| 门头沟区| 德昌县| 罗源县| 沿河| 九江县| 宁南县| 尖扎县| 阜平县| 古田县| 和平县| 乌兰县| 湟中县| 隆德县|