-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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
Conversation
doc/source/user_guide/basics.rst
Outdated
+-------------------------------------------------+---------------------------+--------------------+-------------------------------+----------------------------------------+ | ||
| :ref:`Boolean (with NA) <api.arrays.bool>` | :class:`BooleanDtype` | :class:`bool` | :class:`arrays.BooleanArray` | ``'boolean'`` | | ||
+-------------------------------------------------+---------------------------+--------------------+-------------------------------+----------------------------------------+ | ||
+---------------------------------------------------------------------------------------------+---------------------------+--------------------+-------------------------------+----------------------------------------+ |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok thanks mroeschke
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this 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
doc/source/user_guide/basics.rst
Outdated
| `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'`` | |
There was a problem hiding this comment.
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"
There was a problem hiding this comment.
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”
There was a problem hiding this comment.
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
pandas/core/tools/numeric.py
Outdated
- 'float': smallest float dtype (min.: np.float32) | ||
- 'float': float dtype (min.: np.float32), float16 is not supported. |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this 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
doc/source/user_guide/basics.rst
Outdated
| :ref:`Boolean (with NA) <api.arrays.bool>` | :class:`BooleanDtype` | :class:`bool` | :class:`arrays.BooleanArray` | ``'boolean'`` | | ||
+-------------------------------------------------+---------------------------+--------------------+-------------------------------+----------------------------------------+ | ||
+--------------------------------------------------+---------------------------+--------------------+-------------------------------+----------------------------------------+ | ||
| Kind of Data | Data Type | Scalar | Array | String Aliases | |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
pandas/core/tools/numeric.py
Outdated
- 'float': smallest float dtype (min.: np.float32) | ||
- 'float': float dtype (min.: np.float32), float16 is not supported. |
There was a problem hiding this comment.
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
There was a problem hiding this 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?
thx @natmokval |
Updated documentation for
pandas.to_numeric()
, pointed out thatdowncast
parameter doesn’t supportfloat16
dtype. Listed in the description of dtype supported floating point types and added Link to NumPy types.