Skip to content

Conversation

@loicdiridollou
Copy link
Member

Comment on lines 1328 to 1332
pd.DatetimeIndex(
{ # type: ignore[arg-type]
"Jan. 1, 2008": "New Year’s Day" # pyright: ignore[reportArgumentType]
}
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should work and passing a dict should be acceptable. You have to look at the subclasses of Index (like DatetimeIndex) and modify the __init__() or __new__() methods in those subclasses to accept Axes.

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.

@Dr-Irv Dr-Irv merged commit de6b744 into pandas-dev:main Apr 27, 2025
13 checks passed
@loicdiridollou loicdiridollou deleted the gh828_index_axes branch December 15, 2025 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Argument 1 to "DatetimeIndex" has incompatible type "dict[str, str]"

2 participants