Skip to content

DOC: list supported float dtypes I #50738

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 3 commits into from
Feb 15, 2023

Conversation

natmokval
Copy link
Contributor

Updated documentation for pandas.to_numeric(), pointed out that downcast parameter doesn’t support float16 dtype. Listed in the description of dtype supported floating point types and added Link to NumPy types.

+-------------------------------------------------+---------------------------+--------------------+-------------------------------+----------------------------------------+
| :ref:`Boolean (with NA) <api.arrays.bool>` | :class:`BooleanDtype` | :class:`bool` | :class:`arrays.BooleanArray` | ``'boolean'`` |
+-------------------------------------------------+---------------------------+--------------------+-------------------------------+----------------------------------------+
+---------------------------------------------------------------------------------------------+---------------------------+--------------------+-------------------------------+----------------------------------------+
Copy link
Member

Choose a reason for hiding this comment

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

Could you post a screenshot of how this looks? It's somewhat hard to see what changed from the diff

Choose a reason for hiding this comment

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

so, the issue is fixed? Right ! or can i still push my changes? I am new in open source

Copy link
Member

Choose a reason for hiding this comment

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

Yes, if interested in contributing you can find an issue that hasn't been assigned yet or doesn't have an open pull request

Choose a reason for hiding this comment

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

Ok, thank you. So on an issue only one person can pull a request at one time?

Copy link
Member

Choose a reason for hiding this comment

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

Yes

Choose a reason for hiding this comment

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

Ok thanks mroeschke

Copy link
Contributor Author

Choose a reason for hiding this comment

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

dtypes_pandas

This is a screenshot of that part of the table.
As Marco said, there is no need to add NumPy integer and NumPy float to the table of pandas extension types. I corrected the table and left only "nullable float" under "nullable integer" (without the rest). This implies that we shouldn’t resize the table.

@mroeschke mroeschke added the Docs label Jan 16, 2023
Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

thanks for working on this - I think if you just add "nullable float" to the table (without the rest), then it won't be necessary to resize the table and the diff will be legible, and then we can get this in

Comment on lines 2076 to 2078
| `NumPy integer <https://numpy.org/doc/stable/reference/arrays.scalars.html#numpy.integer>`_ | :class:`numpy.integer` | :class:`int` | :class:`arrays.IntegerArray` | ``'int8'``, ``'int16'``, ``'int32'``, |
| | | | | ``'int64'``, ``'uint8'``, ``'uint16'``,|
| | | | | ``'uint32'``, ``'uint64'`` |
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this needs adding, as this table says

The following table lists all of pandas extension types

All that needs adding is "nullable float" under "nullable integer"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you, @MarcoGorelli . As you suggested, I added "nullable float" to the table and removed integer and float.

I noticed that there is no link to “nullable float”
Wouldn’t be useful to have a description and examples for “nullable float”, as we have for “nullable integer”

Copy link
Member

Choose a reason for hiding this comment

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

yeah, maybe - currently there's no user guide page on nullable floats, but perhaps there should be

- 'float': smallest float dtype (min.: np.float32)
- 'float': float dtype (min.: np.float32), float16 is not supported.
Copy link
Member

Choose a reason for hiding this comment

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

TBH I think this one's clear enough as it is - if it says min: np.float32, then that already implies float16 not being supported

Copy link

Choose a reason for hiding this comment

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

This is a good point. After re-consideration, I agree.

Copy link
Member

Choose a reason for hiding this comment

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

let's revert this change

Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

thanks for updating! almost there

Comment on lines 2078 to 2054
| :ref:`Boolean (with NA) <api.arrays.bool>` | :class:`BooleanDtype` | :class:`bool` | :class:`arrays.BooleanArray` | ``'boolean'`` |
+-------------------------------------------------+---------------------------+--------------------+-------------------------------+----------------------------------------+
+--------------------------------------------------+---------------------------+--------------------+-------------------------------+----------------------------------------+
| Kind of Data | Data Type | Scalar | Array | String Aliases |
Copy link
Member

Choose a reason for hiding this comment

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

looks like this has gone forward by one space 😄 any chance you could bring it back to where it was, to minimise the diff?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you, @MarcoGorelli . I was wondering why my diff was so unreadable. I deleted one space, now it looks nicer 😄.

Also, I reverted line 73 as you suggested.

- 'float': smallest float dtype (min.: np.float32)
- 'float': float dtype (min.: np.float32), float16 is not supported.
Copy link
Member

Choose a reason for hiding this comment

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

let's revert this change

Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

Looks good to me - @phofl any objections?

@MarcoGorelli MarcoGorelli added this to the 2.0 milestone Jan 28, 2023
@phofl phofl merged commit 10b6044 into pandas-dev:main Feb 15, 2023
@phofl
Copy link
Member

phofl commented Feb 15, 2023

thx @natmokval

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DOC: Supported Float dypes not documented
6 participants