I think even in cython this might be difficult as Array data structures are generally considered immutable, so this is inherently unsafe, and requires doing with care.
On Sun, May 29, 2022 at 11:21 AM Cedric Yau <[email protected]> wrote: > Suppose I have an array with 1MM integers and I add 1 to them with > pyarrow.compute.add. It looks like a new array is assigned. > > Is there a way to do this inplace? It looks like a new array is > allocated. Would cython be required at this point? > > ``` > import pyarrow as pa > import pyarrow.compute as pc > > a = pa.array(range(1000000)) > print(id(a)) > a = pc.add(a,1) > print(id(a)) > > # output > # 139634974909024 > # 139633492705920 > ``` > > Thanks, > Cedric >
