-
-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Labels
Dtype ConversionsUnexpected or buggy dtype conversionsUnexpected or buggy dtype conversionsExtensionArrayExtending pandas with custom dtypes or arrays.Extending pandas with custom dtypes or arrays.Missing-datanp.nan, pd.NaT, pd.NA, dropna, isnull, interpolatenp.nan, pd.NaT, pd.NA, dropna, isnull, interpolateNumeric OperationsArithmetic, Comparison, and Logical operationsArithmetic, Comparison, and Logical operations
Milestone
Description
xref #8640
Could easily imagine an ExtensionArray
which uses as an implementation a numpy array of the appropriate dtype and a bitmask in order to fully support Integer NA across the board. I don't think this would be too hard. As a bonus, would be zero-copy compat with pyarrow impl (for the future)
- Integer (ENH: Integer NA Extension Array #21160)UnsignedInteger (ENH: Integer NA Extension Array #21160)
Boolean(API: boolean Extension Array #21778)To pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel.
making these the actual default (e.g. when integers are inferred with or w/o nulls) might be non-trivial, but let's implement first. These would give rise to a hierarchy of dtypes, e.g. IntegerDtype
, Int8Dtype
Metadata
Metadata
Assignees
Labels
Dtype ConversionsUnexpected or buggy dtype conversionsUnexpected or buggy dtype conversionsExtensionArrayExtending pandas with custom dtypes or arrays.Extending pandas with custom dtypes or arrays.Missing-datanp.nan, pd.NaT, pd.NA, dropna, isnull, interpolatenp.nan, pd.NaT, pd.NA, dropna, isnull, interpolateNumeric OperationsArithmetic, Comparison, and Logical operationsArithmetic, Comparison, and Logical operations
Type
Projects
Relationships
Development
Select code repository
Activity
jreback commentedon Apr 15, 2018
cc @jorisvandenbossche @TomAugspurger @wesm @cpcloud
ENH: add integer-na support via an ExtensionArray
jreback commentedon May 13, 2018
here is a fully-function (extension-wise) integer na: https://github.com/jreback/pandas/tree/intna
doesnt break anything and coexists
I have enabled inference to accept the new types with a Registry, e.g.
so construction is pretty flexible now.
next up is ops
cc @TomAugspurger @jorisvandenbossche
jorisvandenbossche commentedon May 14, 2018
Cool!
Is your intention to do a PR to add this to pandas, or to have it as a separate package for now?
ENH: add integer-na support via an ExtensionArray
jreback commentedon May 14, 2018
still needs quite a bit more tests / work. (have arithmetic ops done, but need comparison, and more indexing tests)
But i think directly in pandas. Note that this does not actually switch the base inference (e.g. [1,2 ,3]) still resolves to int64, we can do that at a later point). I suspect will have to change quite a lot of tests as we assume float conversions in a myriad of ways.
ENH: add integer-na support via an ExtensionArray
25 remaining items