The easiest example to create a one-dimensional array would be a straightforward command.After renaming your Jupyter notebook from Untitled to array_basics, the first thing to do is to import the numpy library into your active session by typing in import numpy as np in the In [] command and running the cell.
I like to run this line first to ensure the library is installed properly so if you receive an error, double-check and ensure that conda or pip was set up correctly.See Chapter 2,Overview of Python and Installing Jupyter Notebook, for help.
Next, you want to assign the array object a variable name so you can reference it in future commands.It is common to use single character values such as a or x as a shortcut for your array but for just getting started, let's use something more descriptive, such as my_first_array for easier reference.To the right of the equals sign, we reference the numpy method using np.array followed...