Matplotlib
STEP 1. 막대(Bar) 그래프 import matplotlib.pyplot as plt %matplotlib inline # 그래프 데이터 subject = ['English', 'Math', 'Korean', 'Science', 'Computer'] points = [40, 90, 50, 60, 100] # 축 그리기 fig = plt.figure() ax1 = fig.add_subplot(1,1,1) # 그래프 그리기 ax1.bar(subject, points) # 라벨, 타이틀 달기 plt.xlabel('Subject') plt.ylabel('Points') plt.title("Yuna's Test Result") # 보여주기 plt.savefig('./barplot.png') # 그래프를 이..
2022. 12. 2.
기본수학, numpy
기본 수학 import numpy as np import statistics as st a = [9, 3, 5, 2, 7, 2, 6, 6, 7, 7, 8, 8, 10] 합계 : fsum(a) 평균 : np.mean(a) / st.mean(a) / np.average(a) ; weight 줄 수 있는 가중평균 중앙값: np.median(a) / st.median(a) n이 홀수 : n/2을 반올림한 순서의 값 n이 짝수 : n/2번째 값과 ((n/2) + 1) 번째 값 배열이 짝수일 때, 낮은 중앙값 : median_low , 높은 중앙값 : median_high 최빈값 : np.bincount(a).argmax() / st.mode(a) 가장 빈도수가 많은 값. 가장 많이 나오는 값 : 7 np.binc..
2022. 12. 1.