diags = [a[::-1, :].diagonal(i) for i in range(-a.shape[0] + 1, a.shape[1])]
diags.extend(a.diagonal(i) for i in range(a.shape[1] - 1, -a.shape[0], -1))
print([n.tolist() for n in diags])
Get all the diagonals in a matrix/list of lists in Python