mapleFU commented on issue #35441:
URL: https://github.com/apache/arrow/issues/35441#issuecomment-1536133120

   > Is there no need to add this schema parameter?
   
   Please read the document carefully 
https://arrow.apache.org/docs/python/generated/pyarrow.Table.html#pyarrow.Table.from_pandas
 : 
   
   > 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.
   
   You can print the type to check can it reduce the right type. Personally I 
think it's proper to provide a explicit type.
   
   > how to automatically type conversion
   
   I guess you need to cast the type 
https://arrow.apache.org/docs/python/generated/pyarrow.Table.html#pyarrow.Table.cast
 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to