GitHub user davies opened a pull request:

    https://github.com/apache/spark/pull/3193

    [SPARK-4327] [PySpark] Python API for RDD.randomSplit()

    ```
    pyspark.RDD.randomSplit(self, weights, seed=None)
        Randomly splits this RDD with the provided weights.
    
        :param weights: weights for splits, will be normalized if they don't 
sum to 1
        :param seed: random seed
        :return: split RDDs in an list
    
        >>> rdd = sc.parallelize(range(10), 1)
        >>> rdd1, rdd2, rdd3 = rdd.randomSplit([0.4, 0.6, 1.0], 11)
        >>> rdd1.collect()
        [3, 6]
        >>> rdd2.collect()
        [0, 5, 7]
        >>> rdd3.collect()
        [1, 2, 4, 8, 9]
    ```

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/davies/spark randomSplit

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/3193.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #3193
    
----
commit 41fce544cadce5ed314b75f368abf79ee7fcd2da
Author: Davies Liu <[email protected]>
Date:   2014-11-10T23:54:20Z

    randomSplit()

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to