pandas apply를 사용하여 다중 컬럼(multiple columns) 만들기
from sklearn.datasets import load_boston feature = load_boston() boston_data = pd.DataFrame(feature.data , columns=feature.feature_names) boston_data.head() def f(x, col1 , col2) : x , y = x[col1] , x[col2] plus = x+y minus = x-y multiply = x*y return pd.Series([plus,minus,multiply]) from functools import partial ff = partial(f , col1 = "CRIM", col2="RM") boston_data[["plus","minus","multiply"]]..
2020.06.09