This is an automated email from the ASF dual-hosted git repository.

wesm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new 3155291  ARROW-2680: [Python] Add documentation about type inference 
in Table.from_pandas
3155291 is described below

commit 3155291b0949539a729d53ebf82b386f7483f450
Author: Korn, Uwe <[email protected]>
AuthorDate: Fri Jun 8 20:48:29 2018 -0400

    ARROW-2680: [Python] Add documentation about type inference in 
Table.from_pandas
    
    Author: Korn, Uwe <[email protected]>
    
    Closes #2116 from xhochy/ARROW-2680 and squashes the following commits:
    
    febfe3dd <Korn, Uwe> ARROW-2680:  Add documentation about type inference in 
Table.from_pandas
---
 python/pyarrow/table.pxi | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/python/pyarrow/table.pxi b/python/pyarrow/table.pxi
index 06325a6..96ed55b 100644
--- a/python/pyarrow/table.pxi
+++ b/python/pyarrow/table.pxi
@@ -924,7 +924,20 @@ cdef class Table:
     def from_pandas(cls, df, Schema schema=None, bint preserve_index=True,
                     nthreads=None, columns=None):
         """
-        Convert pandas.DataFrame to an Arrow Table
+        Convert pandas.DataFrame to an Arrow Table.
+
+        The column types in the resulting Arrow Table are inferred from the
+        dtypes of the pandas.Series in the DataFrame. In the case of non-object
+        Series, the NumPy dtype is translated to its Arrow equivalent. In the
+        case of `object`, we need to guess the datatype by looking at the
+        Python objects in this Series.
+
+        Be aware that Series of the `object` dtype don't carry enough
+        information to always lead to a meaningful Arrow type. In the case that
+        we cannot infer a type, e.g. because the DataFrame is of length 0 or
+        the Series only contains None/nan objects, the type is set to
+        null. This behavior can be avoided by constructing an explicit schema
+        and passing it to this function.
 
         Parameters
         ----------

-- 
To stop receiving notification emails like this one, please contact
[email protected].

Reply via email to