[C++][Python] Add multiply/divide kernels for duration and float/double
- Dominant language
- C++
- Stars
- 17.1k
- Forks
- 4.3k
- Avg merge
- 3d 13h
- Merged PRs (30d)
- 88
Description
### Describe the enhancement requested
`numpy` supports multiplying/dividing `timedelta` values with floats and performs automatic rounding to the current unit, e.g.
```python
>>> import numpy as np
>>> x = np.array([0, 1, 2, 3, 4, 5], dtype="timedelta64[s]")
>>> x * 0.5
array([0, 0, 1, 1, 2, 2], dtype='timedelta64[s]')
>>> x * 1.5
array([0, 1, 3, 4, 6, 7], dtype='timedelta64[s]')
```
This is very useful for ML applications where one needs to transform timestamps first to durations and then to floats (and back after performing a forecast). It would be very nice if `pyarrow` supported this as well, so one can directly work with arrow dtypes.
### Component(s)
C++
Contributor guide
Assessment
This issue has not been assessed yet.