-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Strange output from timedelta_range for integer start/end #8886
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
Comments
I think your expected output is this, correct? (but then with specifying the end instead of periods)
I think adding a
I don't think using
Also raising on integer input is not a good idea IMHO, as it is valid input (although maybe not used that much). Possible counterargument: |
I think specifying an integer and a unit is ok, as it is allowed in Though not sure how harder it is to do:
|
There are definitely other ways to get this done, but it is (in my opinion) rather confusing that integers arguments are treated as offsets in So my vote is that this should raise and we don't need any other changes. The main reason I like having a |
ok on raising for integers. The problem with a sane default is that not everyone thinks is sane. |
In my opinion raising on integers in not an option. It is a perfectly valid input (as it is also the default for Also, when would you raise? Only if the end is an integer? Or also if the start is an integer? Because I don't think the following should raise:
|
I think you have to have |
Here I expected a TimedeltaIndex with 11 elements from 0 hours through 11 hours:
It appears that
freq
is taken to refer only to the step size, not the start/stop, and the unit defaults tons
like Timedelta itself? I think we should either:unit
argument -- but this is a subtle distinctionfreq
to also imply theunit
Similarly strange and somewhat inconsistent with the above example:
The text was updated successfully, but these errors were encountered: