NumPy is the fundamental base for scientific computing in python. It contains:

- N-dimensional array objects
- vectorization of functions
- Tools for integrating C/C++ and fortran code
- linear algebra, fourier transformation, and random number tools.

Now, NumPy is the basis for a lot of other packages like scikit-learn, scipy, pandas, among other packages but provides a lot of power in and of itself and they keep numpy pretty abstract however it provides a strong foundation for us to learn some of the operations and concepts we’ll be applying later on.

Let’s go ahead and get started.

```
In [3]:
```import sys
print(sys.version)

```
```

```
In [4]:
```import numpy as np

One of the reasons that numpy is such a popular tool is typically vastly more efficient than standard python lists.

I'm not going to go into the details but things like vectorization and boolean selection not only improve readability but provide for faster operations as well.

Feel free to post questions on the side and I can dive into the details for you all however the big take aways are that we can access data in memory more efficiently, functions can be applied to whole arrays or matrices, and boolean selection allows for simple filtering.

Let's create a list in numpy with np.arange then we’ll get the mean.

```
In [5]:
```range(10)

```
Out[5]:
```

```
In [6]:
```np.arange(10)

```
Out[6]:
```

```
In [7]:
```npa = np.arange(10)

```
In [8]:
```?npa

```
In [9]:
```npa.mean()

```
Out[9]:
```

```
In [10]:
```npa.sum()

```
Out[10]:
```

```
In [11]:
```npa.max()

```
Out[11]:
```

```
In [12]:
```npa.min()

```
Out[12]:
```

```
In [13]:
```[x * x for x in npa]

```
Out[13]:
```

Vectorization in simplest terms allows you to apply a function to an entire array instead of doing it value by value - similar to what we were doing with map and filter in the previous videos. This typically makes things much more concise and readable. Not necessarily in the trivial examples like we’re doing in these initial videos but when we move along into more complicated analysis the speed improvements are significant.

A good rule of thumb is if you’re hard coding for loops with numpy arrays or with certain things in pandas, you're likely doing it wrong. There are much more efficient ways of doing it. This will be come apparent over the next several videos however before we get there, I want to talk about boolean selection.

```
In [ ]:
```