I have a DataFrame generated as follows:
df.groupBy($\"Hour\", $\"Category\") .agg(sum($\"value\").alias(\"TotalValue\")) .sort($\"Hour\".asc,$\"TotalVal
This has been answered here for Spark (Scala):
How can I split a dataframe into dataframes with same column values in SCALA and SPARK
and here for pyspark:
PySpark - Split/Filter DataFrame by column's values