January 2019
Beginner
318 pages
8h 23m
English
In this section, we are going to look at various arithmetic operations on arrays using numpy. For that, first we will create a multidimensional array, as follows:
student@ubuntu:~$ python3Python 3.6.7 (default, Oct 22 2018, 11:32:17)[GCC 8.2.0] on linuxType "help", "copyright", "credits" or "license" for more information.>>> import numpy as np>>> from __future__ import division>>> arr = np.array([[4,5,6],[7,8,9]])>>> arrarray([[4, 5, 6], [7, 8, 9]])>>>
Here, we imported the numpy module to use the numpy functionality, and then we imported the __future__ module that will take care of floats. After that, we created a two dimensional array, arr, to perform various operations on it.
Now, let's look at some arithmetic ...
Read now
Unlock full access