pyspark.sql.DataFrame.distinct

DataFrame.distinct() → pyspark.sql.dataframe.DataFrame

Returns a new DataFrame containing the distinct rows in this DataFrame.

Examples

>>> df.distinct().count()
2