jupyter(2)
-
[Jupyter Notebook] Matplotilb로 데이터 시각화하기
※ 라이브러리 불러오기 import matplotlib.pyplot as plt ※ 필요없는 정보 보여지지 않음 plt.show() 1. 그래프 기본 2. 축 plt.plot(x,y) plt.xlabel('X축', color = 'red', loc = 'right') #loc는 로케이션(위치)로 left, center, right 중에서 선택 plt.ylabel('Y축', color = '#00aa00', loc = 'top') #top, center, bottom 3. 범례 plt.plot(x,y, label='무슨 데이터') plt.legend(loc = (0.7, 0.8)) #x축, y축 0~1사이 4. 스타일 plt.plot(x, y, marker = 'o', markersize = 10, mar..
2022.03.10 -
[Jupyter Notebook] Pandas로 데이터 분석하기
※ 수정사항을 실제 데이터에 바로 반영: inplace=True 1. Series 객체: 1차원 데이터(정수, 실수, 문자열 등) temp = pd.Series([-20, -10, 10, 20], index = ['Jan', 'Feb', 'Mar', 'Apr']) 2. DataFrame 객체: 2차원 데이터 (Series들의 모음) data 이름의 사전을 DataFrame 객체로 생성, Index 지정 import pandas as pd df = pd.DataFrame(data, index = ['1번', '2번', '3번', '4번', '5번', '6번', '7번', '8번']) data 중에서 원하는 column만 선택하거나, 순서 변경 가능 df = pd.DataFrame(data, columns ..
2022.02.28