scala> val df = sc.parallelize(Seq( | (0,"cat26",30.9), | (1,"cat67",28.5), | (2,"cat56",39.6), | (3,"cat8",35.6))).toDF("Hour", "Category", "Value") df: org.apache.spark.sql.DataFrame = [Hour: int, Category: string ... 1 more field] scala> df.show +----+--------+-----+ |Hour|Category|Value| +----+--------+-----+ | 0| cat26| 30.9| | 1| cat67| 28.5| | 2| cat56| 39.6| | 3| cat8| 35.6| +----+--------+-----+