Statistical moments of ndarrays