[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