图片里的身高的类型怎么改成数值类型,为什么用astype 转不了呢?
先用str[0:2]去除尾部的字符串‘cm’,然后用astype('int')转换为数值
data['身高'] = data['身高'].str[0:2].astype('int')