Re:The NumPy array: a structure for efficient numerical comp...
by hatmatrix on Monday August 01, 2016 @07:09AM
(#12201491)
It's a shame that there is no consolidated way to provide index labels to both columns and rows without wrapping this in another class (e.g., your own, or pandas). R's matrices and arrays are very convenient as they provide this functionality out-of-the-box.
[ Parent
| on HN ]
Re:The NumPy array: a structure for efficient numerical comp...
by cgearhart on Monday August 01, 2016 @12:39PM
(#12203802)
I'm not terribly familiar with R, but I've used Pandas a bit. Could you accomplish what you're looking for with structured arrays or record arrays in Numpy?
Re:The NumPy array: a structure for efficient numerical comp...
by hatmatrix on Monday August 01, 2016 @05:57PM
(#12206369)
Record arrays only provide indexing by name along columns, unfortunately. So if you want index labels along both dimensions (in 2-D), Pandas is necessary. There is no good option for the N-D case that I can find (R's native array has this capability by default though).