4 ms·
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 panda
by hatmatrix 10y ago
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.
- cgearhart 10y agoI'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? http://docs.scipy.org/doc/numpy/user/basics.rec.html http://docs.scipy.org/doc/numpy/user/basics.rec.html
- hatmatrix 10y agoRecord 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).