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 6bf2b73 commit 257b9e6Copy full SHA for 257b9e6
python/pyspark/sql.py
@@ -2043,10 +2043,12 @@ def unpersist(self, blocking=True):
2043
# rdd = self._jdf.coalesce(numPartitions, shuffle, None)
2044
# return DataFrame(rdd, self.sql_ctx)
2045
2046
- # def repartition(self, numPartitions):
2047
- # rdd = self._jdf.repartition(numPartitions, None)
2048
- # return DataFrame(rdd, self.sql_ctx)
2049
- #
+ def repartition(self, numPartitions):
+ """ Return a new :class:`DataFrame` that has exactly `numPartitions`
+ partitions.
+ """
2050
+ rdd = self._jdf.repartition(numPartitions, None)
2051
+ return DataFrame(rdd, self.sql_ctx)
2052
2053
def sample(self, withReplacement, fraction, seed=None):
2054
"""
0 commit comments