Is there a better pythonic way of checking if a ndarray is diagonally symmetric in a particular dimension? i.e for all of x
(arr[:,:,x].T==arr[:,:,x]).all()
If your array contains floats (especially if they're the result of a computation), use allclose
np.allclose(arr.transpose(1, 0, 2), arr)
If some of your values might be NaN, set those to a marker value before the test.
NaN
arr[np.isnan(arr)] = 0