谷歌 colab_如何在Google Colab上使用熊猫分析
谷歌 colab
Recently, pandas have come up with an amazing open-source library called pandas-profiling. Generally, EDA starts by df.describe(), df.info() and etc which to be done separately. Pandas_profiling extends the general data frame report using a single line of code: df.profile_report() which interactively describes the statistics, you can read it more here.
最近,熊貓想出了一個了不起的開源庫,叫做pandas-profiling。 通常,EDA從df.describe() , df.info()等開始,這需要分別進行。 Pandas_profiling使用單行代碼df.profile_report()擴展了通用數據框架報告,該代碼以交互方式描述了統計信息,您可以在此處內容。
然而, pandas_profiling不能被直接用在Colab。 該代碼將導致錯誤,如下所示; (However, pandas_profiling cannot be straightforwardly used on Colab. The code will result in an error, as below;)
“concat() got an unexpected keyword argument ‘join axes“This is because Google Colab comes with a pre-installed older version of Pandas-profiling (v1) and the join_axes function is deprecated in the installed Pandas version on Google Colab.
這是因為Google Colab隨附了預先安裝的Pandas分析(v1)的join_axes版本,而在Google Colab上已安裝的Pandas版本中不推薦使用join_axes函數。
Google Colab的兩個主要命令是: (The two main commands for Google Colab are:)
! pip install https://github.com/pandas-profiling/pandas-profiling/archive/master.zipprofile.to_notebook_iframe()
步驟:在Google Colab上安裝Pandas分析 (STEPS : Install Pandas Profiling on Google Colab)
Run the below command, you can visit the link on github.
運行以下命令,您可以訪問github上的鏈接 。
2. Restart the kernel
2.重新啟動內核
3. Re-import the libraries
3.重新導入庫
image by Author圖片作者4. Import and read your data set
4.導入和讀取您的數據集
5. Define your profile report:
5.定義您的個人資料報告:
image by Author圖片作者6. However, profile.to_widgets() is not working properly as it is not yet fully supported on Google Colab, as below snapshot :
6.但是, profile.to_widgets() 無法正常運行,因為Google Colab尚未完全支持它,如下快照所示:
image by Author圖片作者7. Instead, change to profile.to_notebook_iframe(), as below snapshot:
7.而是改為profile.to_notebook_iframe() ,如下快照:
image by Author圖片作者8. And here’s your output:
8.這是您的輸出:
Gif by AuthorGif作者9. Save your output file in html format: so you can share as a webpage
9.將您的輸出文件保存為html格式:這樣您就可以作為網頁共享
Image by Author圖片作者Pandas_profiling displays descriptive overview of the data sets, by showing the number of variables, observations, total missing cells, duplicate rows, memory used and the variable types. Then, it generates detailed analysis for each variable, class distributions, interactions, correlations, missing values, samples and duplicated rows, which you can observe by clicking each tab.
Pandas_profiling通過顯示變量的數量,觀察值,丟失的單元格總數,重復的行,使用的內存和變量類型來顯示數據集的描述性概述。 然后,它為每個變量,類分布,相互作用,相關性,缺失值,樣本和重復行生成詳細分析,您可以通過單擊每個選項卡進行觀察。
I hope this will help you to play around with Pandas profiling.
我希望這將幫助您進行Pandas分析。
Happy exploring!
探索愉快!
翻譯自: https://medium.com/python-in-plain-english/how-to-use-pandas-profiling-on-google-colab-e34f34ff1c9f
谷歌 colab
總結
以上是生活随笔為你收集整理的谷歌 colab_如何在Google Colab上使用熊猫分析的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 老是梦到男人是什么意思
- 下一篇: 做梦梦到鬼了是什么意思