LoginSignup
108
99

More than 3 years have passed since last update.

pandas-profilingが探索的データ解析にめちゃめちゃ便利だった件 - GoogleColab編

Last updated at Posted at 2018-05-05

はじめに

以下記事よりGoogleColabratoryでは表示、挙動が不安定とのこと、解決方法があったので紹介します。
【Pythonメモ】pandas-profilingが探索的データ解析にめちゃめちゃ便利だった件

Colaboratoryでやると表示、挙動が不安定でした。
Kaggle KernelはOK。
Colaboratoryでは何か方法があるかもしれません。
IT詳しい方、ご存知でしたら教えてください。

2020/2/4 追記
以前までは以下のように一度htmlファイルに出力してからfrom IPython.display import HTMLを使って描画するようにしていました。

2020/10/3 追記
下記コードの内容を@Kudaka さんの指摘を受けて修正しました。

import pandas as pd
import warnings
from pandas_profiling import ProfileReport
from pandas_profiling.utils.cache import cache_file

warnings.filterwarnings('ignore')

file_name = cache_file(
    "titanic.csv",
    "https://raw.githubusercontent.com/datasciencedojo/datasets/master/titanic.csv",
)
df = pd.read_csv(file_name)
profile = ProfileReport(df)

profile

pandas_profiling v2.4.0から後処理(HTML(profile))をせずともJupyerNotebooks上で綺麗に表示されるようになったようです。GoogleColabratoryで動かした例を作成しておきましたのでご確認ください。

GoogleColabratory - pandas-profiling tutorial.ipynb

また描画失敗、成功例を紹介していましたがアップデートにより必要なくなったため削除しました。

参考

108
99
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
108
99