Skip to content

Conversation

@cmp0xff
Copy link
Contributor

@cmp0xff cmp0xff commented Dec 25, 2025

Towards #1589, #1469, #1580

A NumpyExtensionArray is produced

  • when no other Pandas array applies
  • when a Python-native or a numpy dtype is imposed (provided that they are not datetime like)

@cmp0xff cmp0xff added the ExtensionArray Extending pandas with custom dtypes or arrays. label Dec 25, 2025
Comment on lines 128 to 130
def value_counts(
self, dropna: bool = True
) -> Series[int]: ... # probably to put in base class
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In NDArrayBackedExtensionArray instead of here.

Copy link
Member

Choose a reason for hiding this comment

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

Are we sure about this, seems like ExtensionArray does not inherit from any other class so wondering how the signature would percolate?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My stand is that either we keep the original inheritance, or we can omit some classes if there is no public API. value_counts is public, and lives in NDArrayBackedExtensionArray, so we should keep it there.

Copy link
Member

@loicdiridollou loicdiridollou left a comment

Choose a reason for hiding this comment

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

Minor questions, will do a second pass tomorrow since it is a rather long PR.

@cmp0xff cmp0xff marked this pull request as draft December 26, 2025 07:10
@cmp0xff
Copy link
Contributor Author

cmp0xff commented Dec 26, 2025

Indeed it is too big, will create a few smaller PRs before the main one

@cmp0xff cmp0xff force-pushed the feature/numpy-extension-array branch 2 times, most recently from 9d39019 to 5af2d1f Compare December 27, 2025 21:06
@cmp0xff cmp0xff linked an issue Dec 27, 2025 that may be closed by this pull request
@cmp0xff cmp0xff force-pushed the feature/numpy-extension-array branch from 5af2d1f to 976490a Compare December 28, 2025 22:31
@cmp0xff cmp0xff changed the title API: pandas-dev/pandas#53694 rename PandasArray -> NumpyExtensionArray TST: xStringArray and NumpyExtensionArray Dec 31, 2025
@cmp0xff cmp0xff marked this pull request as ready for review December 31, 2025 09:15
@cmp0xff cmp0xff requested a review from Dr-Irv December 31, 2025 22:14
Copy link
Collaborator

@Dr-Irv Dr-Irv left a comment

Choose a reason for hiding this comment

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

thanks @cmp0xff

@Dr-Irv Dr-Irv merged commit b54625a into pandas-dev:main Jan 2, 2026
16 checks passed
@cmp0xff cmp0xff deleted the feature/numpy-extension-array branch January 2, 2026 19:53
loicdiridollou pushed a commit that referenced this pull request Jan 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ExtensionArray Extending pandas with custom dtypes or arrays.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants