Skip to content

DOC: Add pyarrow type equivalency table #50474

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jan 4, 2023

Conversation

mroeschke
Copy link
Member

No description provided.

@mroeschke mroeschke added Docs Arrow pyarrow functionality labels Dec 28, 2022
@mroeschke mroeschke added this to the 2.0 milestone Dec 29, 2022
Copy link
Member

@datapythonista datapythonista left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of minor comments, but looks good.

===================================== ========================== ===================
Pyarrow type pandas extension type Numpy type
===================================== ========================== ===================
``pd.ArroeDtype(pa.bool_())`` :class:`BooleanDtype` ``np.bool_``
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
``pd.ArroeDtype(pa.bool_())`` :class:`BooleanDtype` ``np.bool_``
``pd.ArrowDtype(pa.bool_())`` :class:`BooleanDtype` ``np.bool_``

typo

===================================== ========================== ===================
Pyarrow type pandas extension type Numpy type
===================================== ========================== ===================
``pd.ArroeDtype(pa.bool_())`` :class:`BooleanDtype` ``np.bool_``
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think repeating pd.ArrowDtype to wrap every arrow type in this column adds value? Since the column title is Pyarrow type, feels like just using pa.bool_()... is good enough. And maybe a note to comment on creating a pandas arrow type before or after the table could be useful.

Copy link
Member Author

@mroeschke mroeschke Jan 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point. I'll link to the pyarrow factory type functions and explain they need to be passed into pd.ArrowDtype explicitly

The table below shows the equivalent pyarrow-backed (``pa``), pandas extension, and numpy (``np``) types that are recognized by pandas.

===================================== ========================== ===================
Pyarrow type pandas extension type Numpy type
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Pyarrow type pandas extension type Numpy type
PyArrow type pandas extension type NumPy type

I think this is the preferred capitalization.

Copy link
Member

@datapythonista datapythonista left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks @mroeschke

@mroeschke mroeschke merged commit 531ac29 into pandas-dev:main Jan 4, 2023
@mroeschke mroeschke deleted the doc/pyarrow/types branch January 4, 2023 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arrow pyarrow functionality Docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants