Python으로 그래프 작성(산포도)
4626 단어 statisticsPython3
그대로 복사하면 할 수 있습니다.
사용한 데이터(csv 파일)가 잘 게재되지 않았으므로 사진으로 붙여 둡니다.

statistics.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()

Reference
이 문제에 관하여(Python으로 그래프 작성(산포도)), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/tsawa/items/18d8989f477f5cf4198a텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)