The usual default way of creating a Python numpy 2D array from a flat array by reshaping will give a numpy 2D-array object which elements can be addressed by specifying indices or slices representing a row and a column number (zero-based) as the row/column indexing is the default mainstream 2D-indexing based on the concept known from tables and texts where each cell in a table and each character in a text can be identified given its line/row and the column/positionWithinTheLine number (rowNo/lineNo, columnNo)
.
For the purpose of working with array left-right-diagonals(called also diagonals as these are the default considered ones) and the right-left-diagonals(called also anti-diagonals) it would be much easier if the array elements could be addressed using indices or slices expressed in a “diagonal coordinate system” in which each element or slice of the array can be get or set given the diagonal or anti-diagonal indices consisting of the diagonal number (best one-based) and the element index number (best one-based) in that diagonal counted from the diagonal root element (which is an appropriate element on the edge of the array).
Is there an extension to the numpy module available for such purpose? If it isn’t, any idea how to provide a numpy array object supporting indexing of its elements in a diagonal coordinate system which behaves except the way of indexing/slicing like a default numpy array?