You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "Wes McKinney (JIRA)" <ji...@apache.org> on 2017/09/21 00:48:00 UTC

[jira] [Commented] (ARROW-1585) serialize_pandas round trip fails on integer columns

    [ https://issues.apache.org/jira/browse/ARROW-1585?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16174073#comment-16174073 ] 

Wes McKinney commented on ARROW-1585:
-------------------------------------

You mean integer 0 instead of {{"0"}} for the column name, though, right?

{code}
In [7]: df = pd.DataFrame({"0": [1, 2]})

In [8]: df.columns
Out[8]: Index(['0'], dtype='object')
{code}

We made the decision to coerce non-string column names to strings, but we could add metadata to http://pandas-docs.github.io/pandas-docs-travis/developer.html that allows the original dtype to be recovered for the simple cases (e.g. {{Int64Index}}). cc [~cpcloud]

> serialize_pandas round trip fails on integer columns
> ----------------------------------------------------
>
>                 Key: ARROW-1585
>                 URL: https://issues.apache.org/jira/browse/ARROW-1585
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: Python
>    Affects Versions: 0.7.0
>            Reporter: Tom Augspurger
>            Priority: Minor
>             Fix For: 0.8.0
>
>
> This roundtrip fails, since the Integer column isn't converted to a string after deserializing
> {code:python}
> In [1]: import pandas as pd
> im
> In [2]: import pyarrow as pa
> In [3]: pa.deserialize_pandas(pa.serialize_pandas(pd.DataFrame({"0": [1, 2]}))).columns
> Out[3]: Index(['0'], dtype='object')
> {code}
> That should be an {{ Int64Index([0]) }} for the columns.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)