Closed rjavierch closed 6 months ago
Thanks for opening your first issue here at xarray! Be sure to follow the issue template! If you have an idea for a solution, we would really welcome a Pull Request with proposed changes. See the Contributing Guide for more. It may take us a while to respond here, but we really value your contribution. Contributors like you help make xarray better. Thank you!
Thanks for the report. I think this is because we explicitly set freq
to "D"
by default rather than use logic like this to set it to "D"
only if any of periods
, start
, or end
are None
. I think we'd happily take a PR to fix this.
In the meantime you should be able to work around this by explicitly setting freq=None
in your call.
What happened?
I was trying to create a list of a fixed number of N dates from start to end using the "periods" argument of xr.date_range.
What did you expect to happen?
To obtain a DatetimeIndex object with N period's dates between the starting date and the ending date.
Minimal Complete Verifiable Example
MVCE confirmation
Relevant log output
Anything else we need to know?
When running:
Outputs:
DatetimeIndex(['1961-01-01', '1991-01-01'], dtype='datetime64[ns]', freq=None)
Environment