numy array round float values to 0 or 1 code example Example: python round number numpy x = np.round(x, decimals = 4)