We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 35ed378 commit dfe200dCopy full SHA for dfe200d
xarray/core/duck_array_ops.py
@@ -523,8 +523,7 @@ def _timedelta_to_seconds(array):
523
524
def py_timedelta_to_float(array, datetime_unit):
525
"""Convert a timedelta object to a float, possibly at a loss of resolution."""
526
- if not is_duck_array(array):
527
- array = np.asarray(array)
+ array = asarray(array)
528
if is_duck_dask_array(array):
529
array = array.map_blocks(
530
_timedelta_to_seconds, meta=np.array([], dtype=np.float64)
0 commit comments