Skip to content

Instantly share code, notes, and snippets.

@smzn
Created January 6, 2024 08:37
Show Gist options
  • Save smzn/5b0182ff7c313c69a71aca2401ce76ab to your computer and use it in GitHub Desktop.
Save smzn/5b0182ff7c313c69a71aca2401ce76ab to your computer and use it in GitHub Desktop.
全ての組み合わせの散布図を描画する
import pandas as pd
import matplotlib.pyplot as plt
from itertools import combinations
# 列名のリスト
columns = ['Electric Bike Count', 'Classic Bike Count', 'Start Count', 'End Count', 'Member Count', 'Casual Count']
# 全ての組み合わせの散布図を描画する
for col1, col2 in combinations(columns, 2):
plt.figure(figsize=(8, 5))
plt.scatter(aggregated_data[col1], aggregated_data[col2], alpha=0.5)
plt.title(f'{col1} vs {col2}')
plt.xlabel(col1)
plt.ylabel(col2)
plt.grid()
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment