You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by davies <gi...@git.apache.org> on 2015/02/09 19:24:11 UTC
[GitHub] spark pull request: [SPARK-5678] Convert DataFrame to pandas.DataF...
GitHub user davies opened a pull request:
https://github.com/apache/spark/pull/4476
[SPARK-5678] Convert DataFrame to pandas.DataFrame and Series
```
pyspark.sql.DataFrame.to_pandas = to_pandas(self) unbound pyspark.sql.DataFrame method
Collect all the rows and return a `pandas.DataFrame`.
>>> df.to_pandas() # doctest: +SKIP
age name
0 2 Alice
1 5 Bob
pyspark.sql.Column.to_pandas = to_pandas(self) unbound pyspark.sql.Column method
Return a pandas.Series from the column
>>> df.age.to_pandas() # doctest: +SKIP
0 2
1 5
dtype: int64
```
Not tests by jenkins (they depends on pandas)
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/davies/spark to_pandas
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/4476.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 #4476
----
commit 6276fb69887067f1861a543b25da86f8aa0e2b61
Author: Davies Liu <da...@databricks.com>
Date: 2015-02-09T18:21:33Z
Convert DataFrame to pandas.DataFrame and Series
----
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-5678] Convert DataFrame to pandas.DataF...
Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/4476#discussion_r24351854
--- Diff: python/pyspark/sql.py ---
@@ -2284,6 +2284,18 @@ def addColumn(self, colName, col):
"""
return self.select('*', col.alias(colName))
+ def to_pandas(self):
+ """
+ Collect all the rows and return a `pandas.DataFrame`.
+
+ >>> df.to_pandas() # doctest: +SKIP
--- End diff --
why skipping doctest? Does Jenkins not have this?
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-5678] Convert DataFrame to pandas.DataF...
Posted by davies <gi...@git.apache.org>.
Github user davies commented on a diff in the pull request:
https://github.com/apache/spark/pull/4476#discussion_r24356413
--- Diff: python/pyspark/sql.py ---
@@ -2284,6 +2284,18 @@ def addColumn(self, colName, col):
"""
return self.select('*', col.alias(colName))
+ def to_pandas(self):
+ """
+ Collect all the rows and return a `pandas.DataFrame`.
+
+ >>> df.to_pandas() # doctest: +SKIP
--- End diff --
@rxin we have no pandas in jenkins now. We could enable this test once we have it.
@pwendell I think `pandas` is just the project name, `panda` is not meaningful in their context.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-5678] Convert DataFrame to pandas.DataF...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:
https://github.com/apache/spark/pull/4476#issuecomment-73561771
[Test build #27112 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/27112/consoleFull) for PR 4476 at commit [`6276fb6`](https://github.com/apache/spark/commit/6276fb69887067f1861a543b25da86f8aa0e2b61).
* This patch merges cleanly.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-5678] Convert DataFrame to pandas.DataF...
Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on the pull request:
https://github.com/apache/spark/pull/4476#issuecomment-73575901
I filed https://issues.apache.org/jira/browse/SPARK-5693 to track the test issue.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-5678] Convert DataFrame to pandas.DataF...
Posted by pwendell <gi...@git.apache.org>.
Github user pwendell commented on a diff in the pull request:
https://github.com/apache/spark/pull/4476#discussion_r24352749
--- Diff: python/pyspark/sql.py ---
@@ -2284,6 +2284,18 @@ def addColumn(self, colName, col):
"""
return self.select('*', col.alias(colName))
+ def to_pandas(self):
+ """
+ Collect all the rows and return a `pandas.DataFrame`.
+
+ >>> df.to_pandas() # doctest: +SKIP
--- End diff --
should this be called `to_panda` since a single "panda" is equivalent to a data frame
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-5678] Convert DataFrame to pandas.DataF...
Posted by davies <gi...@git.apache.org>.
Github user davies commented on the pull request:
https://github.com/apache/spark/pull/4476#issuecomment-73561116
cc @rxin
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-5678] Convert DataFrame to pandas.DataF...
Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on the pull request:
https://github.com/apache/spark/pull/4476#issuecomment-73575572
Thanks. I'm going to merge this.
@pwendell what's the process for installing Pandas on Jenkins machines?
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-5678] Convert DataFrame to pandas.DataF...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:
https://github.com/apache/spark/pull/4476#issuecomment-73575086
Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/27112/
Test PASSed.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-5678] Convert DataFrame to pandas.DataF...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:
https://github.com/apache/spark/pull/4476#issuecomment-73575076
[Test build #27112 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/27112/consoleFull) for PR 4476 at commit [`6276fb6`](https://github.com/apache/spark/commit/6276fb69887067f1861a543b25da86f8aa0e2b61).
* This patch **passes all tests**.
* This patch merges cleanly.
* This patch adds no public classes.
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-5678] Convert DataFrame to pandas.DataF...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/spark/pull/4476
---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org