aboutsummaryrefslogtreecommitdiff
path: root/python/pyspark/sql/dataframe.py
diff options
context:
space:
mode:
authorTommy YU <tummyyu@163.com>2016-02-06 17:29:09 +0000
committerSean Owen <sowen@cloudera.com>2016-02-06 17:29:09 +0000
commit81da3bee669aaeb79ec68baaf7c99bff6e5d14fe (patch)
tree269905def89ac9cd4cf438d1b45e2d261b0531b4 /python/pyspark/sql/dataframe.py
parent4f28291f851b9062da3941e63de4eabb0c77f5d0 (diff)
downloadspark-81da3bee669aaeb79ec68baaf7c99bff6e5d14fe.tar.gz
spark-81da3bee669aaeb79ec68baaf7c99bff6e5d14fe.tar.bz2
spark-81da3bee669aaeb79ec68baaf7c99bff6e5d14fe.zip
[SPARK-5865][API DOC] Add doc warnings for methods that return local data structures
rxin srowen I work out note message for rdd.take function, please help to review. If it's fine, I can apply to all other function later. Author: Tommy YU <tummyyu@163.com> Closes #10874 from Wenpei/spark-5865-add-warning-for-localdatastructure.
Diffstat (limited to 'python/pyspark/sql/dataframe.py')
-rw-r--r--python/pyspark/sql/dataframe.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/python/pyspark/sql/dataframe.py b/python/pyspark/sql/dataframe.py
index 90a6b5d9c0..3a8c8305ee 100644
--- a/python/pyspark/sql/dataframe.py
+++ b/python/pyspark/sql/dataframe.py
@@ -739,6 +739,9 @@ class DataFrame(object):
def head(self, n=None):
"""Returns the first ``n`` rows.
+ Note that this method should only be used if the resulting array is expected
+ to be small, as all the data is loaded into the driver's memory.
+
:param n: int, default 1. Number of rows to return.
:return: If n is greater than 1, return a list of :class:`Row`.
If n is 1, return a single Row.
@@ -1330,6 +1333,9 @@ class DataFrame(object):
def toPandas(self):
"""Returns the contents of this :class:`DataFrame` as Pandas ``pandas.DataFrame``.
+ Note that this method should only be used if the resulting Pandas's DataFrame is expected
+ to be small, as all the data is loaded into the driver's memory.
+
This is only available if Pandas is installed and available.
>>> df.toPandas() # doctest: +SKIP