0 [1, 2, 3] 1 foo 2 [] 3 [3, 4] dtype: object
#导入pandas库import pandas as pd#OneHotEncoder用来将数值型类别变量转换为0-1的标志性变量#LabelEncoder用来将字符串型变量转换为数值型变量from sklearn.preprocessing import OneHotEncoder,LabelEncoder ......
#导入库import pandas as pdimport numpy as npfrom sklearn.preprocessing import Imputer#生成缺失数据df=pd.DataFrame(np.random.randn(6,4),columns=['col1','col2','col3...
import pandas as pd#生成数据data1,data2,data3,data4=['a',3],['b',2],['a',3],['c',2]df=pd.DataFrame([data1,data2,data3,data4],columns=['col1','col...
import pandas as pd#生成异常数据df=pd.DataFrame({'col1':[1,120,3,5,2,12,13], 'col2':[12,17,31,53,22,32,43]})print(df) col1 col20 1 12...