raise ValueError("Input matrix can only have two dimensions or less")
if np.any(mat < 0):
raise ValueError("Cannot have negative proportions")
if np.any(np.logical_not(np.isclose(mat.sum(axis=1), 1))):
raise ValueError("Rows need to sum up to 1")
z_mat = (mat == 0)
After Change
raise ValueError("Input matrix can only have two dimensions or less")
if np.any(mat < 0):
raise ValueError("Cannot have negative proportions")
if not np.all(np.isclose(mat.sum(axis=1), 1)):
raise ValueError("Rows need to sum up to 1")
z_mat = (mat == 0)