NumPy ufuncLesson 34Free preview
ufunc Simple Arithmetic
This lesson is part of NumPy · All levels
Summary
NumPy provides simple arithmetic functions such as add, subtract, multiply, divide, power, mod, and divmod which are all element-wise. Keep in mind that division produces a float, including when both of its operations are integers. Operators +, -, *, / are also the same ufunc callback behind the screen.
Key points
- Add, subtract, multiply, divide the working elements by the elements.
- Power counts the rank and mod counts the rest of the.
- Divmod returns the tuple at once.
- NumPy splits always produce a float type.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.