randolf-scholz commented on issue #39233:
URL: https://github.com/apache/arrow/issues/39233#issuecomment-2070756267

   There are 2 more operations supported by `numpy` that are missing in the 
list above:
   
   1. `multiply(duration, double/float) -> duration`
   2. `divide(duration, double/float) -> duration`
   
   In both cases, `numpy` performs automatic rounding towards the specified 
time resolution:
   
   ```python
   import numpy as np
   td = np.timedelta64(5, "D")
   print(td * 1.5)  # 7 days
   print(td / 1.5)  # 3 days
   ```
   
   Especially the multiply kernel would be very useful, because it is the 
inverse operation to the `divide(duration, duration) -> double` kernel, which 
is needed if one wants to reverse pre-processing transformations.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to