jorisvandenbossche commented on issue #39991:
URL: https://github.com/apache/arrow/issues/39991#issuecomment-1933956627

   > > ```
   > > array([array([1, 2, 3, 4, 5, 6], dtype=int8),
   > >        array([ 7,  8,  9, 10, 11, 12], dtype=int8)], dtype=object)
   > > ```
   > 
   > 
   > In which circumstances is this a desirable behavior? It even makes a copy, 
right?
   
   I agree it will _typically_ not be the case, but it can still be the 
desirable behaviour for any context where you need a 1D array (and expect 
`to_numpy()` to give you that). Another example of such context is constructors 
like `pd.Series` that expect a 1D array.
   
   FWIW it does not make a copy. Similarly as our ListArray -> numpy convrsion, 
each subarray is a slice from one converted parent ndarray (of course it still 
needs to allocate the object-dtype 1D array that hold those zero-copy 
subarrays).


-- 
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