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

ENH: linspace behavior for timedelta_range and interval_range #20976

Closed
jschendel opened this Issue May 8, 2018 · 1 comment

Comments

Projects
None yet
3 participants
@jschendel
Member

jschendel commented May 8, 2018

Behavior similar to np.linspace has been implemented for the regular date_range function in #20846, e.g. pd.date_range(start='2018-01-01', end='2018-01-10', periods=50).

This behavior is not supported by timedelta_range or interval_range, so it seems like it should be added for consistency with date_range.

Note that this behavior doesn't really make sense for period_range since a frequency is always required. Likewise it doesn't really make sense for bdate_range, as the only distinguishing feature from date_range is the support for custom business day logic, and the default freq being 'B', both of which imply a frequency. Doubly so for cdate_range, as it's been deprecated in favor of bdate_range.

@jschendel jschendel changed the title from ENH: linspace behavior for bdate_range/timedelta_range/interval_range to ENH: linspace behavior for timedelta_range and interval_range May 9, 2018

@jschendel

This comment has been minimized.

Member

jschendel commented May 9, 2018

Thinking about this some more, I don't think this behavior makes sense for bdate_range either; the only distinguishing feature from date_range is the support for custom business day logic, and the default freq being 'B', both of which imply a frequency.

Updated the title and modified the original post accordingly.

I suppose this could be implemented easily enough for bdate_range but the linspace behavior would be identical to that of date_range.

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