You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "davlee1972 (via GitHub)" <gi...@apache.org> on 2023/06/09 14:16:06 UTC

[GitHub] [arrow] davlee1972 commented on issue #29892: [Python] List array conversion to Numpy N-d array

davlee1972 commented on issue #29892:
URL: https://github.com/apache/arrow/issues/29892#issuecomment-1584652312

   Wouldn't it be better to convert an arrow tensor type into an arrow list of structs?
   This would make multidimensional matrixes searchable..
   You could also write this efficiently to parquet.
   
   What is missing in the solution above are the names for x (3 columns) and y (2 rows).
   
           Bob | Mary | John
   Kids         1 | 2 | 3
   Cars         4 | 5 | 6
   
   `[{'Bob', 'Kids',  1}, {'Bob', 'Cars', 4}, {'Mary', 'Kids',  2}, {'Mary', 'Cars', 5}, {'John', 'Kids',  3}, {'John', 'Cars', 6}]`
   
   ```
   pa.schema([
       pa._list(
           pa.struct([
               pa.field('person', pa.string()),
               pa.field('has', pa.string()),
               pa.field('count', pa.int32()),
           ])
       )
   ])
   ```
   
   
   
   
   
   
   


-- 
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: github-unsubscribe@arrow.apache.org

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