M Is Not A Numpy Array Neither A Scalar