MENU
  • ホーム
  • Contact Us
Hayashi's discovery-oriented learning | 地域研究と分析の林
地域研究と分析の林
  • ホーム
  • Contact Us
地域研究と分析の林
  • ホーム
  • Contact Us
Youtubeチャンネルはこちら(鉄道趣味メイン)
  1. ホーム
  2. データ前処理と即席可視化
  3. ヒストグラム

ヒストグラム

idvalue1value2
id11519
id2153
id3207
id4814
id5132
id645
id71111
id8177
id91812
id1083
id1113
id121615
Python
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
bin = np.linspace(0,20,10)
plt.hist([df['value1'], df['value2']], bins=bin, alpha=0.7, label=['value1', 'value2'])
plt.xlabel('Values')
plt.ylabel('Frequency')
plt.title('Histogram of value1 and value2')
plt.legend()
plt.show()
# サブプロットを作成
fig, ax = plt.subplots()

# ヒストグラムをプロット
ax.hist([df['value1'], df['value2']], bins=10, alpha=0.7, label=['value1', 'value2'])
ax.set_xlabel('Values')
ax.set_ylabel('Frequency')
ax.set_title('Histogram of value1 and value2')
ax.legend()

# グラフを表示
plt.show()
スポンサーリンク
新着記事
  • 鳳派出所の風景(後編)
  • 鳳派出所の風景(中編)
  • 鳳派出所の風景(前編)
おすすめ

Youtubeチャンネル
https://www.youtube.com/watch?v=w2q30VHcXj4
  • ホーム
  • Contact Us

© 地域研究と分析の林.