hombit opened a new issue, #44544:
URL: https://github.com/apache/arrow/issues/44544

   ### Describe the enhancement requested
   
   `numpy` supports broadcasting, allowing operations between arrays of 
different lengths (e.g., multi-element and single-element arrays). It would be 
beneficial if pyarrow could implement similar behavior.
   
   Example:
   
   ```python
   import numpy as np
   import pyarrow as pa
   
   # Works in numpy
   np.array([1, 2, 3]) + np.array([4])
   
   # Also works in pyarrow with a scalar
   pa.compute.add(pa.array([1, 2, 3]), 4)
   
   # Doesn't work in pyarrow with an array - raises
   # ArrowInvalid: Array arguments must all be the same length
   pa.compute.add(pa.array([1, 2, 3]), pa.array([4]))
   ```
   
   This issue arose from a discussion in a related Pandas issue: 
https://github.com/pandas-dev/pandas/issues/60073.
   
   ### Component(s)
   
   Python


-- 
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: issues-unsubscr...@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to