Skip to content

Conversation

@thrasibule
Copy link
Contributor

closes #11804

This changes the definition of 'left' and 'right'. If the generated_dates are strictly within (start, end), then changing the value of closed has no impact. Before the code would always remove the leftmost date or rightmost date independently of the value of start and end.

@jreback jreback added Bug Datetime Datetime data dtype Frequency DateOffsets labels Dec 10, 2015
@jreback jreback added this to the 0.18.0 milestone Dec 10, 2015
@jreback
Copy link
Contributor

jreback commented Dec 10, 2015

need some tests for this. pls use all of the examples that you provided on gitter.

@jreback jreback removed this from the 0.18.0 milestone Dec 10, 2015
Copy link
Contributor

Choose a reason for hiding this comment

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

if not left_closed and len(index) and index[0] == start

@thrasibule thrasibule force-pushed the daterange_fix branch 3 times, most recently from 941f7fd to a3125c6 Compare December 10, 2015 22:48
Copy link
Contributor

Choose a reason for hiding this comment

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

also add in closed=None.

Further do this test for start/end on the boundaries & not on the boundaries.

I think you should have 9 possibilities here (3 from closed parm, 3 from if start/end on boundary)

@jreback
Copy link
Contributor

jreback commented Dec 17, 2015

lgtm. can you add a whatsnew note (bug fixes), and squash. ping when green.

@jreback jreback added this to the 0.18.0 milestone Dec 17, 2015
@thrasibule
Copy link
Contributor Author

@jreback done. I wasn't sure if there is a specific order for the whatsnew notes, let me know if I didn't do it right. Thanks.

jreback added a commit that referenced this pull request Dec 17, 2015
be more careful with half-opened date_range
@jreback jreback merged commit 71f652d into pandas-dev:master Dec 17, 2015
@jreback
Copy link
Contributor

jreback commented Dec 17, 2015

@thrasibule thanks! no specific order in whatsnew, best to put it in the middle somewhere as that tends to not cause merge conflicts (and the reason I leave space for it)

@thrasibule thrasibule deleted the daterange_fix branch December 18, 2015 19:31
@thrasibule
Copy link
Contributor Author

Thanks for merging!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Datetime Datetime data dtype Frequency DateOffsets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DatetimeIndex with closed='left' or 'right' drop dates at the boundaries

2 participants