GitHub user eshilts opened a pull request:

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

    [SPARK-10291] [PySpark] statsByKey method for RDD

    Added statsByKey() method for computing summary statistics of each key in 
an RDD.
    
    ```python
    x = sc.parallelize([("key_a", 1.0), ("key_a", 2.0), ("key_b", 2.0), 
("key_b", 3.0)])
    s = sorted(x.statsByKey().collect())
    s[0]
    #('key_a', (count: 2, mean: 1.5, stdev: 0.5, max: 2.0, min: 1.0))
    s[1]
    #('key_b', (count: 2, mean: 2.5, stdev: 0.5, max: 3.0, min: 2.0))
    ```
    
    https://issues.apache.org/jira/browse/SPARK-10291

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

    $ git pull https://github.com/eshilts/spark SPARK-10291-statsByKey

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

    https://github.com/apache/spark/pull/8539.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 #8539
    
----
commit 43d26626ee85a608ff14287a3fd5eb0e30aae71a
Author: Erik Shilts <[email protected]>
Date:   2015-08-31T13:49:59Z

    [SPARK-10291] [PySpark] statsByKey method for RDD
    
    Added statsByKey() method for computing summary statistics of each key
    in an RDD.

----


---
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