科学の箱

科学・IT・登山の話題

Python

SIGNATE お弁当の需要予測-4

投稿日:2018年5月17日 更新日:

今回はSeabornのpairplotを利用して相関の概要を見てみる。ただし相関を見るためにはデータのクレンジングが必要。

まずはnullデータのヒートマップを確認してみる。


sns.heatmap(d_train.isnull(),yticklabels=False,cbar=False,cmap='viridis')

次にデータのクレンジング


d_train_w=d_train.fillna({'kcal':0})
d_train_w = d_train_w.drop('event', axis=1)
d_train_w = d_train_w.drop('remarks', axis=1)
d_train_w = d_train_w.drop('precipitation', axis=1)
d_train_w = d_train_w.drop('name', axis=1)
d_train_w = d_train_w.drop('payday', axis=1)

データのフォーマット確認


d_train_w.head()

もう一度ヒートマップで確認


sns.heatmap(d_train_w.isnull(),yticklabels=False,cbar=False,cmap='viridis')

ペアプロット作成

sns.pairplot(d_train_w)
sns.pairplot(d_train_w, hue='weather')

 

 

メタ情報

inarticle



メタ情報

inarticle



-Python
-,

執筆者:


comment

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

関連記事

no image

python data scientist bootcamp

pythonでdata分析をしたいと思ったが学校に通う時間もお金もない。udemyで検索したところ英語版であるが1400円!でコースが見つかったのでこちらを受けることにした。 https://www. …

no image

wordpress-xmlrpc

WordPressへPythonから投稿してみる。 まずは設定から。説明はこちらにある。 https://python-wordpress-xmlrpc.readthedocs.io/en/lates …

no image

RoboBrowserで提供しているメソッドget_linksにおけるパラメータの指定方法

get_linksは便利だが文字列を指定する際に少々手間取った。 結論から言うと文字列で指定する方法とre.compileオブジェクトを指定する方法の2つがある。 まず一つ目は単純な文字列。exact …

no image

python coding styleのツール

Pythonで使えるコーディングツール pep8 flake8 pylint   Related posts:automated the boring – day 3pandaの基本中の基本 …

no image

matplotlibでfigureを利用する

matplotlibでfigureオブジェクトを利用するとグラフを表示する位置を細かく指定できる。 まずはfigureを使ってグラフを一つ表示してみる。 >>> import mat …

2018年5月
« 4月   6月 »
 123456
78910111213
14151617181920
21222324252627
28293031  

side bar top



アーカイブ

カテゴリー