Importing NumPy

Once you start a new IPython or Jupyter session, you can import the NumPy module and verify its version as follows:

In [1]: import numpy
In [2]: numpy.__version__
Out[2]: '1.15.4'
Recall that in the Jupyter Notebook, you can hit Ctrl + Enter to execute a cell once you have typed the command. Alternatively, Shift + Enter executes the cell and automatically inserts or selects the cell below it. Check out all of the keyboard shortcuts by clicking on Help | Keyboard Shortcut or take a quick tour by clicking on Help | User Interface Tour.

For the parts of the package discussed here, I would recommend using NumPy version 1.8 or later. By convention, you'll find that most people in the scientific Python world will import NumPy using np as an alias:

In [3]: import numpy as np
In [4]: np.__version__
Out[4]: '1.15.4'

Throughout this chapter and the rest of this book, we will stick to the same convention.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.47.166