본문 바로가기

Python39

tqdm Library ( 반복문 진행 상황을 로딩bar로 보여주는 라이브러리 ) from tqdm import tqdm_notebook as tq 이후 for 문 앞에 괄호로 tq()로 묶기! for i, row in enumerate 를 쓸 경우 : tq로 묶어주면서 안에 total = ? 를 넣어준다 2022. 7. 5.
encoding(인코딩)의 4가지 방법 1. "euc-kr"' 2. "utf-8" 3. ''" (공백) 4. "utf-8-sig" 4가지로 진행해보고 안될경우 구글링 필요함 2022. 7. 4.
txt, csv, json file Python에서 불러오기 // csv파일로 저장하기 -----------코랩에 파일 업로드하는 방법-------------- from google.colab.import files uploaded = files.upload() ------------txt파일 넘파이로 불러오기----------------- import numpy as np data명 = np.loadtxt("파일명.txt", delimeter=",") delimeter : 데이터가 어떤 기호로 구분됐는지 적어주는것 ---------------- csv 파일 pandas로 불러오기------------ impor pandas as pd data명= pd.readcsv("파일명.csv", encoding="euc-kr") ---------------- json 파일 불러오기----------.. 2022. 7. 1.
Matplotlib Library (Line Chart그리기 / LIne Style 바꾸기 / Marker 종류 / Pie Chart 그리기 등) -임포트 import matplotlib.pyplot as plt from matplotlib import rc rc('font', family='폰트종류') -->> 폰트 인코딩 작업 rc('font', family='Malgun Gothic') -형태 plt.title('그래프제목', loc='left or center or right ) plt.그래프타입(데이터값, color='색상', label='범례내용', range(시작숫자, 종료숫자+1, 간격)) plt.xlabel()--> x라벨에 이름붙이기 plt.ylabel()--> y라벨에 이름붙이기 plt.figure(figsize=(x축크기,y축크기)) plt.legend() --> 범례 출력하기 plt.scatter() --> 그래프에 점찍기 .. 2022. 6. 13.