前提
Python Autovizでデータの可視化を試しています。
以下、URLの通りコードを作成し、Jupyter notebookで実行したのですが、
グラフが表示されません。
https://choron81.hatenablog.com/entry/2022/08/15/000000
実現したいこと
Autovizで参考のWEBページで見られるような、データの可視化をしたのですが、改善点などアドバイスいただければ幸いです。
実行結果(実行後に発生しているメッセージ)
Shape of your Data Set loaded: (100, 5) ####################################################################################### ######################## C L A S S I F Y I N G V A R I A B L E S #################### ####################################################################################### Classifying variables in data set... Data cleaning improvement suggestions. Complete them before proceeding to ML modeling. Nuniques dtype Nulls Nullpercent NuniquePercent Value counts Min Data cleaning improvement suggestions V 100 float64 0 0.000000 100.000000 0 W 100 float64 0 0.000000 100.000000 0 X 100 float64 0 0.000000 100.000000 0 Y 100 float64 0 0.000000 100.000000 0 Z 100 float64 0 0.000000 100.000000 0 5 Predictors classified... No variables removed since no ID or low-information variables found in data set Number of All Scatter Plots = 15 No categorical or numeric vars in data set. Hence no bar charts. All Plots done Time to run AutoViz = 1 seconds ###################### AUTO VISUALIZATION Completed ########################エラーメッセージ
該当のソースコード
import pandas as pd import numpy as np V=np.random.normal(0,10,100) W=[np.random.normal(0,5) + i*1.3 for i in V] X=[np.random.normal(0,10) + i*(-0.8) for i in V] Y=[abs(i+10)*10 + 1 for i in V] Z=np.random.normal(10,10,100) df=pd.DataFrame(zip(V,W,X,Y,Z),columns=["V","W","X","Y","Z"]) from autoviz.AutoViz_Class import AutoViz_Class autoviz = AutoViz_Class().AutoViz("",dfte=df)
> Jupyter notebookで実行した
のならば、
> from autoviz.AutoViz_Class import AutoViz_Class
のすぐ下に下記を追加してから、実行してみてください
%matplotlib inline
【追記】
jupyterでの最初の
> autoviz = AutoViz_Class().AutoViz("",dfte=df)
の実行では、先頭に
「After importing, execute '%matplotlib inline' to display charts in Jupyter.」
と表示されてたはずです
2回目以降の実行では、質問に記載のように
> Shape of your Data Set loaded: (100, 5)
以降しか表示されませんが
ありがとうございます。できました。
