Create Spark DataFrame. Can not infer schema for type
SparkSession.createDataFrame, which is used under the hood, requires an RDD / list of Row/tuple/list/dict* or pandas.DataFrame, unless schema with DataType is provided. Try to convert float to tuple like this: myFloatRdd.map(lambda x: (x, )).toDF() or even better: from pyspark.sql import Row row = Row(“val”) # Or some other column name myFloatRdd.map(row).toDF() To create a DataFrame … Read more