show distinct column values in pyspark dataframe: python

后端 未结 9 907
忘了有多久
忘了有多久 2020-12-23 10:55

Please suggest pyspark dataframe alternative for Pandas df[\'col\'].unique().

I want to list out all the unique values in a pyspark dataframe column.

9条回答
  •  别那么骄傲
    2020-12-23 11:24

    You can use df.dropDuplicates(['col1','col2']) to get only distinct rows based on colX in the array.

提交回复
热议问题