Skip to content

DOC: Series.name is just Hashable, but many column arguments require str #61432

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

Closed
1 task done
cmp0xff opened this issue May 12, 2025 · 1 comment · Fixed by #61455
Closed
1 task done

DOC: Series.name is just Hashable, but many column arguments require str #61432

cmp0xff opened this issue May 12, 2025 · 1 comment · Fixed by #61455
Labels
Docs good first issue Reshaping Concat, Merge/Join, Stack/Unstack, Explode

Comments

@cmp0xff
Copy link
Contributor

cmp0xff commented May 12, 2025

Pandas version checks

  • I have checked that the issue still exists on the latest versions of the docs on main here

Location of the documentation

Documentation problem

In the documentation, Series.name is just required to be a Hashable. When pandas functions ask for a column label, however, it often asks for an str, e.g. in DataFrame.pivot, where it says

columns: str or object or a list of str

Suggested fix for documentation

Use Hashable everywhere to column labels as a function argument

@cmp0xff cmp0xff added Docs Needs Triage Issue that has not been reviewed by a pandas team member labels May 12, 2025
@cmp0xff cmp0xff closed this as not planned Won't fix, can't repro, duplicate, stale May 15, 2025
@cmp0xff cmp0xff reopened this May 15, 2025
@rhshadrach
Copy link
Member

Thanks for the report. Hashable is correct, but the docs often use label instead, e.g.

https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.set_index.html

I think we should use label for consistency.

@rhshadrach rhshadrach added Reshaping Concat, Merge/Join, Stack/Unstack, Explode good first issue and removed Needs Triage Issue that has not been reviewed by a pandas team member labels May 18, 2025
cmp0xff pushed a commit to cmp0xff/pandas that referenced this issue May 19, 2025
cmp0xff pushed a commit to cmp0xff/pandas that referenced this issue May 19, 2025
@cmp0xff cmp0xff mentioned this issue May 19, 2025
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs good first issue Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants