We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cb4915e commit 79059fdCopy full SHA for 79059fd
python/pyspark/sql/dataframe.py
@@ -417,12 +417,18 @@ def unpersist(self, blocking=True):
417
def repartition(self, numPartitions):
418
""" Return a new :class:`DataFrame` that has exactly `numPartitions`
419
partitions.
420
+
421
+ >>> df.repartition(10).rdd.getNumPartitions()
422
+ 10
423
"""
424
return DataFrame(self._jdf.repartition(numPartitions), self.sql_ctx)
425
426
def distinct(self):
427
428
Return a new :class:`DataFrame` containing the distinct rows in this DataFrame.
429
430
+ >>> df.distinct().count()
431
+ 2L
432
433
return DataFrame(self._jdf.distinct(), self.sql_ctx)
434
0 commit comments