Created
January 6, 2024 08:42
-
-
Save smzn/fdeacccb3f92582e37dfe4326d188e62 to your computer and use it in GitHub Desktop.
相関係数を計算
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import seaborn as sns | |
import matplotlib.pyplot as plt | |
# 列名のリスト | |
columns = ['Electric Bike Count', 'Classic Bike Count', 'Start Count', 'End Count', 'Member Count', 'Casual Count'] | |
# 相関係数を計算 | |
correlation_matrix = aggregated_data[columns].corr() | |
# ヒートマップの描画 | |
plt.figure(figsize=(10, 8)) | |
sns.heatmap(correlation_matrix, annot=True, cmap='coolwarm', fmt=".2f") | |
plt.title('Correlation Matrix Heatmap') | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment