-
-
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2050,33 +2050,42 @@ The following table lists all of pandas extension types. For methods requiring ` | |
arguments, strings can be specified as indicated. See the respective | ||
documentation sections for more on each type. | ||
|
||
+-------------------------------------------------+---------------------------+--------------------+-------------------------------+----------------------------------------+ | ||
| Kind of Data | Data Type | Scalar | Array | String Aliases | | ||
+=================================================+===============+===========+========+===========+===============================+========================================+ | ||
| :ref:`tz-aware datetime <timeseries.timezone>` | :class:`DatetimeTZDtype` | :class:`Timestamp` | :class:`arrays.DatetimeArray` | ``'datetime64[ns, <tz>]'`` | | ||
| | | | | | | ||
+-------------------------------------------------+---------------+-----------+--------------------+-------------------------------+----------------------------------------+ | ||
| :ref:`Categorical <categorical>` | :class:`CategoricalDtype` | (none) | :class:`Categorical` | ``'category'`` | | ||
+-------------------------------------------------+---------------------------+--------------------+-------------------------------+----------------------------------------+ | ||
| :ref:`period (time spans) <timeseries.periods>` | :class:`PeriodDtype` | :class:`Period` | :class:`arrays.PeriodArray` | ``'period[<freq>]'``, | | ||
| | | | ``'Period[<freq>]'`` | | | ||
+-------------------------------------------------+---------------------------+--------------------+-------------------------------+----------------------------------------+ | ||
| :ref:`sparse <sparse>` | :class:`SparseDtype` | (none) | :class:`arrays.SparseArray` | ``'Sparse'``, ``'Sparse[int]'``, | | ||
| | | | | ``'Sparse[float]'`` | | ||
+-------------------------------------------------+---------------------------+--------------------+-------------------------------+----------------------------------------+ | ||
| :ref:`intervals <advanced.intervalindex>` | :class:`IntervalDtype` | :class:`Interval` | :class:`arrays.IntervalArray` | ``'interval'``, ``'Interval'``, | | ||
| | | | | ``'Interval[<numpy_dtype>]'``, | | ||
| | | | | ``'Interval[datetime64[ns, <tz>]]'``, | | ||
| | | | | ``'Interval[timedelta64[<freq>]]'`` | | ||
+-------------------------------------------------+---------------------------+--------------------+-------------------------------+----------------------------------------+ | ||
| :ref:`nullable integer <integer_na>` | :class:`Int64Dtype`, ... | (none) | :class:`arrays.IntegerArray` | ``'Int8'``, ``'Int16'``, ``'Int32'``, | | ||
| | | | | ``'Int64'``, ``'UInt8'``, ``'UInt16'``,| | ||
| | | | | ``'UInt32'``, ``'UInt64'`` | | ||
+-------------------------------------------------+---------------------------+--------------------+-------------------------------+----------------------------------------+ | ||
| :ref:`Strings <text>` | :class:`StringDtype` | :class:`str` | :class:`arrays.StringArray` | ``'string'`` | | ||
+-------------------------------------------------+---------------------------+--------------------+-------------------------------+----------------------------------------+ | ||
| :ref:`Boolean (with NA) <api.arrays.bool>` | :class:`BooleanDtype` | :class:`bool` | :class:`arrays.BooleanArray` | ``'boolean'`` | | ||
+-------------------------------------------------+---------------------------+--------------------+-------------------------------+----------------------------------------+ | ||
+---------------------------------------------------------------------------------------------+---------------------------+--------------------+-------------------------------+----------------------------------------+ | ||
| Kind of Data | Data Type | Scalar | Array | String Aliases | | ||
+=============================================================================================+===============+===========+========+===========+===============================+========================================+ | ||
| :ref:`tz-aware datetime <timeseries.timezone>` | :class:`DatetimeTZDtype` | :class:`Timestamp` | :class:`arrays.DatetimeArray` | ``'datetime64[ns, <tz>]'`` | | ||
| | | | | | | ||
+---------------------------------------------------------------------------------------------+---------------+-----------+--------------------+-------------------------------+----------------------------------------+ | ||
| :ref:`Categorical <categorical>` | :class:`CategoricalDtype` | (none) | :class:`Categorical` | ``'category'`` | | ||
+---------------------------------------------------------------------------------------------+---------------------------+--------------------+-------------------------------+----------------------------------------+ | ||
| :ref:`period (time spans) <timeseries.periods>` | :class:`PeriodDtype` | :class:`Period` | :class:`arrays.PeriodArray` | ``'period[<freq>]'``, | | ||
| | | | ``'Period[<freq>]'`` | | | ||
+---------------------------------------------------------------------------------------------+---------------------------+--------------------+-------------------------------+----------------------------------------+ | ||
| :ref:`sparse <sparse>` | :class:`SparseDtype` | (none) | :class:`arrays.SparseArray` | ``'Sparse'``, ``'Sparse[int]'``, | | ||
| | | | | ``'Sparse[float]'`` | | ||
+---------------------------------------------------------------------------------------------+---------------------------+--------------------+-------------------------------+----------------------------------------+ | ||
| :ref:`intervals <advanced.intervalindex>` | :class:`IntervalDtype` | :class:`Interval` | :class:`arrays.IntervalArray` | ``'interval'``, ``'Interval'``, | | ||
| | | | | ``'Interval[<numpy_dtype>]'``, | | ||
| | | | | ``'Interval[datetime64[ns, <tz>]]'``, | | ||
| | | | | ``'Interval[timedelta64[<freq>]]'`` | | ||
+---------------------------------------------------------------------------------------------+---------------------------+--------------------+-------------------------------+----------------------------------------+ | ||
| :ref:`nullable integer <integer_na>` | :class:`Int64Dtype`, ... | (none) | :class:`arrays.IntegerArray` | ``'Int8'``, ``'Int16'``, ``'Int32'``, | | ||
| | | | | ``'Int64'``, ``'UInt8'``, ``'UInt16'``,| | ||
| | | | | ``'UInt32'``, ``'UInt64'`` | | ||
+---------------------------------------------------------------------------------------------+---------------------------+--------------------+-------------------------------+----------------------------------------+ | ||
| `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 commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this needs adding, as this table says
All that needs adding is "nullable float" under "nullable integer" There was a problem hiding this comment. Choose a reason for hiding this commentThe 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” There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
+---------------------------------------------------------------------------------------------+---------------------------+--------------------+-------------------------------+----------------------------------------+ | ||
| ``nullable float`` | :class:`Float64Dtype`, ...| (none) | :class:`arrays.FloatingArray` | ``'Float32'``, ``'Float64'`` | | ||
+---------------------------------------------------------------------------------------------+---------------------------+--------------------+-------------------------------+----------------------------------------+ | ||
| `NumPy float <https://numpy.org/doc/stable/reference/arrays.scalars.html#numpy.floating>`_ | :class:`numpy.floating` | :class:`float` | :class:`arrays.FloatingArray` | ``'float16'``, ``'float32'``, | | ||
| | | | | ``'float64'`` | | ||
+---------------------------------------------------------------------------------------------+---------------------------+--------------------+-------------------------------+----------------------------------------+ | ||
| :ref:`Strings <text>` | :class:`StringDtype` | :class:`str` | :class:`arrays.StringArray` | ``'string'`` | | ||
+---------------------------------------------------------------------------------------------+---------------------------+--------------------+-------------------------------+----------------------------------------+ | ||
| :ref:`Boolean (with NA) <api.arrays.bool>` | :class:`BooleanDtype` | :class:`bool` | :class:`arrays.BooleanArray` | ``'boolean'`` | | ||
+---------------------------------------------------------------------------------------------+---------------------------+--------------------+-------------------------------+----------------------------------------+ | ||
|
||
pandas has two ways to store strings. | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,7 +70,7 @@ def to_numeric( | |
|
||
- 'integer' or 'signed': smallest signed int dtype (min.: np.int8) | ||
- 'unsigned': smallest unsigned int dtype (min.: np.uint8) | ||
- 'float': smallest float dtype (min.: np.float32) | ||
- 'float': float dtype (min.: np.float32), float16 is not supported. | ||
MarcoGorelli marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. let's revert this change |
||
|
||
As this behaviour is separate from the core conversion to | ||
numeric values, any errors raised during the downcasting | ||
|
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.