randolf-scholz opened a new issue, #38329:
URL: https://github.com/apache/arrow/issues/38329

   ### Describe the enhancement requested
   
   `ndim` and `shape` are both part of the [Buffer 
Protocol](https://docs.python.org/3/c-api/buffer.html), and most array like 
structures support them. It would be useful to add these attributes to 
facilitate code rewrite / generic code.
   
   |                   | len() | ndim | shape |
   |-------------------|-------|------|-------|
   | pyarrow.Array     |  ✅    |  ❌   |   ❌   |
   | pyarrow.Table     |  ✅    |  ❌   |   ✅   |
   | memoryview        |  ✅    |  ✅   |   ✅   |
   | numpy.ndarray     |  ✅    |  ✅   |   ✅   |
   | pandas.Index      |  ✅    |  ✅   |   ✅   |
   | pandas.Series     |  ✅    |  ✅   |   ✅   |
   | pandas.DataFrame  |  ✅    |  ✅   |   ✅   |
   | torch.Tensor      |  ✅    |  ✅   |   ✅   |
   | tensorflow.Tensor |  ✅    |  ✅   |   ✅   |
   | xarray.DataArray  |  ✅    |  ✅   |   ✅   |
   
   
   ### 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: [email protected]

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

Reply via email to