In the line:
n = int(numpy.round(n))
you are rounding a single floating-point value to the nearest integer before converting it to an int.
While this is correct and works well, it’s worth noting that numpy.round() is a general-purpose function that supports rounding to a specified number of decimal places (decimals argument). In this case, since you're only rounding to the nearest integer, a more efficient and semantically appropriate alternative is:
n = int(numpy.rint(n))