赞
踩
from pyspark.mllib.feature import Normalizer normlizer = Normalizer() vector = sc.parallelize([x]) normalized_x_mllib = normlizer.transform(vector).first().toArray()