Skip to content

DOC: fix doctests for pandas/core/generic.py for new string dtype #61907

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

Conversation

arthurlw
Copy link
Member

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

Part of #61886

@arthurlw arthurlw added the Docs label Jul 19, 2025
@jorisvandenbossche jorisvandenbossche added the Strings String extension data type and string data label Jul 19, 2025
@@ -885,7 +885,7 @@ def squeeze(self, axis: Axis | None = None) -> Scalar | Series | DataFrame:
dtype: int64

>>> even_primes.squeeze()
np.int64(2)
2
Copy link
Member

Choose a reason for hiding this comment

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

With which version of numpy are you running the doctests locally?
I personally don't particularly like the np.int64(2) repr for in the docstrings, but I see that was recently changed in #60987 to follow the latest numpy

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah right, thanks for catching that. I’ll revert it

@jorisvandenbossche jorisvandenbossche added this to the 3.0 milestone Jul 19, 2025
@@ -11804,7 +11804,7 @@ def first_valid_index(self) -> Hashable:
>>> print(df.last_valid_index())
None

If all elements in DataFrame are NA/null, returns None.
If all elements in DataFrame are NA/null, returns NaN.
Copy link
Member

Choose a reason for hiding this comment

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

The example below still shows None?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah my bad, thanks.

@jorisvandenbossche jorisvandenbossche merged commit 13f7b8b into pandas-dev:main Jul 21, 2025
43 checks passed
@jorisvandenbossche
Copy link
Member

Thanks!

@arthurlw arthurlw deleted the core/generic_repr_changes branch July 21, 2025 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs Strings String extension data type and string data
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants