Skip to content

Conversation

loicdiridollou
Copy link
Member

Copy link
Contributor

@cmp0xff cmp0xff left a comment

Choose a reason for hiding this comment

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

From the description in #1419, it seems the following tests are yet to be added:

  • When the base instance is not of DatetimeIndex but just of a normal Index, .where also works with the changes
  • other being a Series

Please make the tests complete. Thanks!

Comment on lines 1616 to 1618
datetime_index = pd.DatetimeIndex(
pd.date_range(start="2025-01-01", freq="h", periods=48)
)
Copy link
Contributor

Choose a reason for hiding this comment

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

pd.date_range already gives a DatetimeIndex at run time. You can do

Suggested change
datetime_index = pd.DatetimeIndex(
pd.date_range(start="2025-01-01", freq="h", periods=48)
)
datetime_index = pd.date_range(start="2025-01-01", freq="h", periods=48)

unless you need to cast (which can be fixed separately)

@loicdiridollou loicdiridollou marked this pull request as draft October 10, 2025 20:09
@loicdiridollou
Copy link
Member Author

Converting to draft until response from pandas team.

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.

Index.where(..., other) should support other with more than array-like

2 participants