AttributeError: 'DataFrame' object has no attribute 'map'
AttributeError: 'DataFrame' object has no attribute 'map' Question: I wanted to convert the spark data frame to add using the code below: from pyspark.mllib.clustering import KMeans spark_df = sqlContext.createDataFrame(pandas_df) rdd = spark_df.map(lambda data: Vectors.dense([float(c) for c in data])) model = KMeans.train(rdd, 2, maxIterations=10, runs=30, initializationMode=”random”) The detailed error message is: ————————————————————————— AttributeError Traceback (most recent …