Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 3.x 将数据转换为特征向量_Python 3.x_Scikit Learn_K Means_Demographics_Feature Clustering - Fatal编程技术网

Python 3.x 将数据转换为特征向量

Python 3.x 将数据转换为特征向量,python-3.x,scikit-learn,k-means,demographics,feature-clustering,Python 3.x,Scikit Learn,K Means,Demographics,Feature Clustering,我有MovieLens数据中的用户统计信息。我正在尝试在它上面应用kmeans算法 Age Occupation Zip-code 0 1 10 48067 1 56 16 70072 2 25 15 55117 3 45 7 2460 4 25 20 55455 我想把它转换成这样的特征向量 f1,f2,

我有MovieLens数据中的用户统计信息。我正在尝试在它上面应用kmeans算法

Age  Occupation  Zip-code
0       1          10     48067
1      56          16     70072
2      25          15     55117
3      45           7      2460
4      25          20     55455
我想把它转换成这样的特征向量

f1,f2,f3, . ........ , f27
例如,每个值都转换为特征 年龄将被转换为7岁