Making histogram with Spark DataFrame column

前端 未结 6 1978
盖世英雄少女心
盖世英雄少女心 2020-12-16 03:18

I am trying to make a histogram with a column from a dataframe which looks like

DataFrame[C0: int, C1: int, ...]

If I were to make a histog

6条回答
  •  一个人的身影
    2020-12-16 03:37

    If you want a to plot the Histogram, you could use the pyspark_dist_explore package:

    fig, ax = plt.subplots()
    hist(ax, df.groupBy("C1").count().select("count"))
    

    If you would like the data in a pandas DataFrame you could use:

    pandas_df = pandas_histogram(df.groupBy("C1").count().select("count"))
    

提交回复
热议问题