摘要:
``` #导入pandas库 import pandas as pd #OneHotEncoder用来将数值型类别变量转换为0-1的标志性变量 #LabelEncoder用来将字符串型变量转换为数值型变量 from sklearn.preprocessing import OneHotEncoder,LabelEncoder #生成数据 df=pd.DataFrame({'id':[321313, 阅读全文
摘要:
``` #导入库 import pandas as pd import numpy as np from sklearn.preprocessing import Imputer #生成缺失数据 df=pd.DataFrame(np.random.randn(6,4),columns=['col1','col2','col3','col4']) df.iloc[1:2,1] = np.nan #增 阅读全文