import numpy as np import pandas as pd # 수치 계산에 사용하는 라이브러리 %precision 3 # 표시 자리수 지정 from matplotlib import pyplot as plt # 그래프를 그리기 위한 라이브러리 %matplotlib inline # 그래프를 주피터 노트북 상에 표시
x = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) y = np.array([2, 3, 4, 3, 5, 4, 6, 7, 4, 8])
plt.plot(x, y) plt.title("Inlineplot matplotlib") plt.xlabel("X") plt.ylabel("Y")
import seaborn as sns sns.set() plt.plot(x, y, color = 'blue') plt.title("Inlineplot seaborn") plt.xlabel("X") plt.ylabel("Y")
data = np.array([2, 3, 3, 4, 4, 4, 4, 5, 5, 6]) # 데이터 생성
sns.distplot(data, bins = 5, color = 'blue', kde = False)
sns.distplot(data, color = 'blue')
fish_multi = pd.read_excel("C:\\Users\\KIM EUNKI\\fish_multi.xlsx") sns.boxplot(data = fish_multi, x = 'species', y = 'length', color = 'gold')
sns.violinplot(data = fish_multi, x = 'species', y = 'length', color = 'silver')
sns.barplot(data = fish_multi, x = 'species', y = 'length', color = 'red')
cov_data = pd.read_excel("C:\\Users\\KIM EUNKI\\cov_data.xlsx") sns.jointplot(data = cov_data, x = 'x', y = 'y', color = 'gray')
iris = sns.load_dataset("iris") iris.head(3)
iris.groupby('species').mean()
sns.pairplot(iris, hue = 'species') # hue = '카테고리의 변수 이름'