with_Feature_1_array = train_df~train_dfFeature_1isnastackvalueswithout_Feature_1_array = train_dftrain_dfFeature_1isnastackvalues解释上述代码并说明values有什么作用
上述代码将训练集(train_df)中"Feature_1"列不为空的数据堆叠为一维数组(with_Feature_1_array),将"Feature_1"列为空的数据堆叠为一维数组(without_Feature_1_array)。
.values()表示返回DataFrame或Series中的值,而不是返回其索引。在这里,它将DataFrame对象转化为numpy数组。
原文地址: https://www.cveoy.top/t/topic/fhec 著作权归作者所有。请勿转载和采集!