def units2digit( x:str ):
return np.argwhere( units == x )[0][0]
cols = ['col_name_01', 'col_name_02',]
for col in cols:
unique = data[col].unique()
data[col] = data[col].map( units2digit )
使用说明:
字符串转成数字
def units2digit( x:str ):
return np.argwhere( units == x )[0][0]
cols = ['col_name_01', 'col_name_02',]
for col in cols:
unique = data[col].unique()
data[col] = data[col].map( units2digit )
使用说明:
字符串转成数字