๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ


Python

(75)
[Python] Pandas - Dataframe for ๋ฌธ ์กฐํšŒ for i, row in df.iterrows(): print(row['name']) # ๊ฐ’ ๋ณ€๊ฒฝ df.loc[i, 'name'] = 'Jenny'
[Python/Flask] ์™ธ๋ถ€ Front๋กœ Redirect ํ•  ๋•Œ ๋ฐ์ดํ„ฐ ์ „์†ก
[Python] Pandas - DataFrame ์ด์ƒ์น˜ ์ œ๊ฑฐ def dr_outlier(df): quartile_1 = df.quantile(0.25) quartile_3 = df.quantile(0.75) IQR = quartile_3 - quartile_1 condition = (df (quartile_3 + 1.5 * IQR)) condition = condition.any(axis=1) search_df = df[condition] return search_df, df.drop(search_df.index, axis=0) https://wikidocs.net/83562 ์œ„ํ‚ค๋…์Šค ์˜จ๋ผ์ธ ์ฑ…์„ ์ œ์ž‘ ๊ณต์œ ํ•˜๋Š” ํ”Œ๋žซํผ ์„œ๋น„์Šค wikidocs.net https://ko.khanacademy.org/ma..
[Python] Pandas - DataFrame ํŠน์ • ์—ด ์„ ํƒ df = df[['a', 'c']]
[Python] Pandas - Dataframe : apply, lambda ์ด์šฉํ•œ ๊ฐ’ ๋ณ€๊ฒฝ df = pd.DataFrame({'test': [ '1,000' ,'20000' ,'3000' ,'4,330' ]}) df['test'] = df.apply(lambda x: x['test'].replace(",", "").replace(" ", "") if x['test'] else '', axis=1) for๋ฌธ์—์„œ ๋ณ€๊ฒฝํ•˜๊ธฐ for i, row in df.iterrows(): row.loc[i, 'age2'] = row['age'] + 10
[Python] Pandas - DataFrame ์ธ๋ฑ์Šค reset ํ•˜๊ธฐ reset_index() ํ•จ์ˆ˜ ์‚ฌ์šฉ df ์ž์ฒด๋ฅผ reset ์ƒํƒœ๋กœ ์ €์žฅ : inplace=True # df ์ƒ์„ฑ df = pd.DataFrame({'a': [1,np.NaN,3,np.NaN,4,3,2]}) # NaN ๊ฐ’ ์ œ๊ฑฐ df = df.dropna() # index resetํ•˜๊ธฐ - ๊ธฐ์กด index ์ œ๊ฑฐ X df.reset_index(drop=False) # index resetํ•˜๊ธฐ - ๊ธฐ์กด index ์ œ๊ฑฐ O df.reset_index(drop=True) sort ๋‚ด๋ฆผ์ฐจ์ˆœ : ascending=False df ์ž์ฒด๋ฅผ ์ •๋ ฌ๋œ ์ƒํƒœ๋กœ ์ €์žฅ : inplace=True df.sort_values(by=['name'], inplace=True)
[Python] Pandas - Dataframe ๋ฆฌ์ŠคํŠธ ์ด์šฉํ•œ ํ•„ํ„ฐ : isin ์‚ฌ์šฉ
[Python] ๋ฐฐ์—ด(๋ฆฌ์ŠคํŠธ) ๋งˆ์ง€๋ง‰ ์›์†Œ ์ฐพ๊ธฐ -1 ์ธ๋ฑ์Šค ์ด์šฉ