## 7 – NumPy 6 V1

Let’s see how NumPy does arithmetic operations on arrays. NumPy allows element-wise operations, as well as matrix operations. In this video, we will only be looking at element-wise operations. Consider these two rank one arrays. We can perform basic element-wise operations using arithmetic symbols or functions. Both of these forms will do the same operation. … Read more

## 6 – NumPy 5 V1

Up to now we’ve seen how to make slices and select elements of an NumPy array using indices. This is useful when we know the exact indices of the elements we want to select. However, there are many situations in which we don’t know the indices of the elements we want. For example; Suppose we … Read more

## 5 – NumPy 4 V1

As we mentioned earlier, in addition to accessing individual elements one at a time, we can access subsets of NumPy arrays with slicing. Slicing is performed by combining indices with a colon inside the brackets. In general, you will come across three ways of slicing. First, slicing from a starting index to an ending index. … Read more

## 4 – NumPy 3 V1

Now that you know how to create a variety of NumPy arrays, let’s see how NumPy allows us to effectively manipulate the data within them. NumPy arrays are mutable, meaning the elements in them can be changed after the array has been created. NumPy arrays can also be sliced in many different ways. This allows … Read more

## 3 – NumPy 2 V1

In the last video, we learnt how to create NumPy arrays by converting existing array like objects such as Python lists, using NumPy’s array function. But one great time saving feature of NumPy is its ability to generate specific kinds of NumPy arrays from nothing, using just one line of code. Here, we will see … Read more

## 2 – NumPy 1 V1

Generally, there are two ways to create Numpy arrays. First, using Numpy’s array function to create them from other array-like objects such as regular Python lists. And second, using a variety of built-in Numpy functions that quickly generate specific types of arrays. In this section, we will start with the first way. Let’s import Numpy … Read more

## 1 – NumPy 0 V1

NumPy is short for Numerical Python and is a library designed for efficient Scientific Computation. It’s built on top of the programming language C, which works at a lower level on our computer. To understand what this means for the speed of our code, see the link in the instructor notes. At the core of … Read more

## 3-3-2-15. Mini-Project: Mean Normalization and Data Separation

Mean Normalization

## 3-3-2-14. Getting Set Up for the Mini-Project

Getting Set Up for the Mini-Project There are two ways to code for the current Mini-Project: Workspace – You can use the Workspace provided on the very next page. The workspace already has the project instructions to follow. Your Personal Computer – You will have to use the Jupyter notebook on your PC or Mac. If you do not … Read more

## 3-3-2-13. Glossary

Glossary Below is the summary of all the functions and methods that you learned in this lesson: Category: General Purpose Function/Method Description numpy.ndarray.dtype Return the data-type of the elements of the array. Remember, arrays are homogeneous. numpy.ndarray.ndim Return the number of array-dimensions (rank), e.g., it will return 2 for a 4×3 array. numpy.ndarray.shape Return a tuple representing … Read more

## 3-3-2-12. Creating ndarrays with Broadcasting

create_ndarray.py solution.py

## 3-3-2-11. Arithmetic operations and Broadcasting

Let’s see how NumPy does arithmetic operations on arrays. NumPy allows element-wise operations, as well as matrix operations. In this video, we will only be looking at element-wise operations. Consider these two rank one arrays. We can perform basic element-wise operations using arithmetic symbols or functions. Both of these forms will do the same operation. … Read more

## 3-3-2-10. Manipulating ndarrays

pick_odd.py solution.py

## 3-3-2-9. Boolean Indexing, Set Operations, and Sorting

Up to now we’ve seen how to make slices and select elements of an NumPy array using indices. This is useful when we know the exact indices of the elements we want to select. However, there are many situations in which we don’t know the indices of the elements we want. For example; Suppose we … Read more

## 3-3-2-8. Slicing ndarrays

As we mentioned earlier, in addition to accessing individual elements one at a time, we can access subsets of NumPy arrays with slicing. Slicing is performed by combining indices with a colon inside the brackets. In general, you will come across three ways of slicing. First, slicing from a starting index to an ending index. … Read more

## 3-3-2-7. Accessing, Deleting, and Inserting Elements Into ndarrays

Now that you know how to create a variety of NumPy arrays, let’s see how NumPy allows us to effectively manipulate the data within them. NumPy arrays are mutable, meaning the elements in them can be changed after the array has been created. NumPy arrays can also be sliced in many different ways. This allows … Read more

## 3-3-2-6. Create an ndarray

Try creating the same array using the np.linspace() function. The answer is below: np.linspace(2,32,16).reshape(4,4)

## 3-3-2-5. Using Built-in Functions to Create ndarrays

In the last video, we learnt how to create NumPy arrays by converting existing array like objects such as Python lists, using NumPy’s array function. But one great time saving feature of NumPy is its ability to generate specific kinds of NumPy arrays from nothing, using just one line of code. Here, we will see … Read more

## 3-3-2-4. Creating and Saving NumPy ndarrays

Generally, there are two ways to create Numpy arrays. First, using Numpy’s array function to create them from other array-like objects such as regular Python lists. And second, using a variety of built-in Numpy functions that quickly generate specific types of arrays. In this section, we will start with the first way. Let’s import Numpy … Read more

## 3-3-2-3. Why Use NumPy?

NumPy is short for Numerical Python and is a library designed for efficient Scientific Computation. It’s built on top of the programming language C, which works at a lower level on our computer. To understand what this means for the speed of our code, see the link in the instructor notes. At the core of … Read more