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-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-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-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-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