More than 5 years have passed since last update.
記録として残していきます。
そのままコピーしてやればできます。
使用したデータ(csvファイル)がうまく掲載できなかったので、写真で貼っておきます。
👁 スクリーンショット 2017-11-01 午前1.38.15.pngstatistics.py
import pandas as pd
import matplotlib.pyplot as plt
from pandas.plotting import scatter_matrix
statistics.py
data = pd.read_csv("row_data.csv")
data.describe()
statistics.py
plt.scatter(data['age'], data['expenses'])
plt.ylabel('expenses')
plt.xlabel('age')
plt.show()
statistics.py
plt.scatter(data['smoker'], data['expenses'])
plt.ylabel('expenses')
plt.xlabel('smoke')
plt.show()
statistics.py
plt.scatter(data['bmi'], data['expenses'])
plt.ylabel('expenses')
plt.xlabel('bmi')
plt.show()
statistics.py
plt.figure()
scatter_matrix(data)
plt.show()
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme
