listcomprehension ์ธ๋ค์ผํ ๋ฆฌ์คํธํ 1/11 ์ 1. tqdm in list comprehension / in pandas import pandas as pd import numpy as np from tqdm import tqdm # from tqdm.notebook import tqdm # Ver. 1 For Jupyter Notebook # from tqdm.auto import tqdm # Ver. 2 For Jupyter Notebook def process(token): return token['text'] l1 = [{'text': k} for k in range(5000)] l2 = [process(token) for token in tqdm(l1)] # tqdm in list comprehension #------------------.. ๋๋ณด๊ธฐ 8/23 ํ 1. pass์ continue์ ์ฐจ์ด for i in range(5): if i % 2 == 0: pass # ์๋ฌด๊ฒ๋ ํ์ง ์์ print(i) # 0 # 1 # 2 # 3 # 4 for i in range(5): if i % 2 == 0: continue # ํ๋จ์ ์ฝ๋๋ฅผ ์คํํ์ง ์๊ณ ๋์ด๊ฐ ์๋จ์ ๋ฐ๋ณต๋ฌธ์ ๋ง์ ์คํํจ print(i) # 1 # 3 2. ๋ถ๋์์์ ์ ์ค์ฐจ ์ปดํจํฐ์์ ๋ถ๋์์์ ์ซ์๋ค์ 2์ง ๋ถ์๋ก ํํ๋๊ธฐ์ ๊ฝค ๋ง์ ๊ฐ์ ์ ํํ ํํ๋ ์ ์๋ค. ๊ทธ๋ ๊ธฐ์ ์ฌ๋์ด ์ดํดํ๊ธฐ ์ฝ๊ฒ ์ ๋ ฅํ๋ 10์ง ๋ถ๋์์์ ์ซ์๋ 2์ง ๋ถ๋์์์ ์ซ์๋ก ๊ทผ์ฌ ๋๋ค. ๋ถ๋์์์ ์ ์ค์ฐจ๋ฅผ ํด๊ฒฐํ๊ธฐ ์ํด์ ์์ฃผ ์ฌ์ฉ๋๋ ํจ์๋ round()์ math ๋ชจ๋์ math.isclose()๊ฐ ์๋ค. round(.. ๋๋ณด๊ธฐ ์ด์ 1 ๋ค์