Consider the following code
import numpy as np
a = np.array([10,20,30])
b = np.array([3,5,7])
print(np.mod(a,b))
Output:
[1 0 2]
import numpy as np
a = np.array([10,20,30])
b = np.array([3,5,7])
print(np.remainder(a,b))
Output:
[1 0 2]
Both functions gave the same value, are there any differences?
No difference, they are aliases:
>>> np.mod is np.remainder
True
Specifically, mod is alias for remainder:
>>> np.mod.__name__
'remainder'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With