4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

備忘録 pandas dataframeのplot()機能をお手軽に使う

Posted at

pandasでDataFrame.plot()を簡単に使います

準備

以下をインポートしておきましょう

header.py
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib as mpl

pandas df をプロットする

df用のデータは別途用意しておいてください

plotter.py

df=np.DataFrame(list)#適当にdfを定義する

# X軸に列を指定して、すべてのプロットを同じグラフに描画する
df.plot( x='指定列名')

#X軸に列を指定して、プロット毎にグラフを分ける
df.plot(x='指定列名', subplots=True, sharex=True)

# 表示と終了
plt.show()
plt.close('all')

##こんな感じで表示されました
Figure_2.png
Figure_1.png

こちらの記事が非常に分かりやすくて参考になります

4
3
0

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
4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?