You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@arrow.apache.org by "Joris Van den Bossche (Jira)" <ji...@apache.org> on 2020/04/14 09:23:00 UTC

[jira] [Created] (ARROW-8442) [Python] NullType.to_pandas_dtype inconsisent with dtype returned in to_pandas/to_numpy

Joris Van den Bossche created ARROW-8442:
--------------------------------------------

             Summary: [Python] NullType.to_pandas_dtype inconsisent with dtype returned in to_pandas/to_numpy
                 Key: ARROW-8442
                 URL: https://issues.apache.org/jira/browse/ARROW-8442
             Project: Apache Arrow
          Issue Type: Bug
          Components: Python
            Reporter: Joris Van den Bossche


There is this behaviour of {{to_pandas_dtype}} returning float, while all actual conversions to numpy or pandas use object dtype:

{code}
In [23]: pa.null().to_pandas_dtype()                                                                                                                                                                               
Out[23]: numpy.float64

In [24]: pa.array([], pa.null()).to_pandas()                                                                                                                                                                       
Out[24]: Series([], dtype: object)

In [25]: pa.array([], pa.null()).to_numpy(zero_copy_only=False)                                                                                                                                                    
Out[25]: array([], dtype=object)
{code}

So we should probably fix {{NullType.to_pandas_dtype}} to return object, which is used in practice.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)