 Hello everyone. Welcome to this course, namely NumPy for Data Science. Data Science is one of the hottest fields of the year 2020 and this field is expected to grow exponentially in the coming years. If you want to become a data scientist, it is very important that you are very well aware of the language used in this field, namely Python and the library is used, which comes integrated with the Python language. So moving on, there are many, many libraries in Python that are used in this field, such as matplotlib, tensorflow, numpy, pandas. If you want to become a successful data scientist, it is very important that you have a good knowledge of how to use these libraries so that you can play well with the data. Because right now, data is the king. If you know how to use the data, you can very well turn the tide. So we would be learning about NumPy library in this course. Now about me, my name is Suraj and I would be your course instructor. I am a Mernstag web developer, open source contributor. I also write tech blogs at hash node and dev. So if you want, you can have a look at them. Apart from that, I am also machine learning enthusiast and I have a knowledge of algorithms, tools and libraries used in Python programming language. So the question rises, what exactly is data science? A data scientist's job is to convert raw data into a valuable one using different tools, algorithms and libraries. And everyone knows how to extract the right data that is valuable and useful for a company's business. This can shoot the business of the company 10 x times. Hence, this field is one of the most demanded fields. If you look 10 years back, this field was not much in talks, but right now it is in talks. The reason being we have data. We have years of data right now. And all you need is the skill to extract the valuable information which can be used for the growth of a company or a business. Moving on, what exactly is NumPy? NumPy is a Python library. But what is the use of this library? So this library is basically used for scientific computing. This library contains powerful multidimensional array objects. Now it is important to know what exactly is an array. In simple words, array is a data structure that stores or contains group of elements. And this package gives you powerful multidimensional array objects, which can be used for various tasks. Now those tasks would include mathematical operations, manipulations, sorting, various other operations. It even gives you the liberty of using linear algebra functions and Fourier transformations. The list goes on. So you can understand how useful this library is. Now the tools required to use this library, there are two tools that you can use for using this NumPy library. The first being Google collab online tool. This is the link. Don't worry about the links. I will be providing these links in the course resources page. Okay, so you can right now just follow me. You can follow this link. And as you can see, we have reached the collab page. And now you can open a workspace or we call it here as notebook. You can name your notebook as practice and open your new notebook. As you can see, you have opened your notebook. And here you can run all the codes which I would be explaining throughout the course. And you can very well executed here. For example, I type this command, this symbol means run the cell. If you click on the symbol, it will start executing this part of code. This is an online web based Python notebook that you have accessed. Okay, now to add a code, you can click on this button and you can add another piece of code. And so on. You can run every part of the cell by clicking on this button. And if you want to stop, you can click on this restart and time or restart and run off. There are various options that you can discover over here. You can have a look of all of them and very well use the online tool if you wish to. Otherwise, we can even learn how to use the offline tool to run Python programs in which we would be using the NumPy package. Moving on. The second tool being Jupyter notebook. Now this is an offline tool. You need to download this notebook from the link that I would be sharing over here. And you need to install this notebook. And once you have installed this notebook, you can run the Python programs commands and use the NumPy package over there and follow the course. Don't worry, I would be providing you with a link. And as you can see, I have opened the web page. You can download this package. Click on the download button. And you can choose whether you want Windows or macOS and download this installer. Now I have already downloaded this and you can check over here and click here and install this setup. Click on next. I agree. Just me next. And you can choose your directory and move on. It may take some time to install this package. But once you have installed it, you can move on. I've already installed this package on my PC. You can very well install it and jump to the course. I hope you have successfully installed the package and now we would be jumping directly into the course. I would be covering everything related to NumPy. I would be explaining everything from the grass root level. So see you in the next module. Welcome to this module. I hope you could install Anaconda easily and played around the software. Let's jump into one of the components that Anaconda software provides us namely Jupyter notebook. We would be using this tool to run our Python programs, which would be having NumPy library. As you can see, we have opened Jupyter notebook. We can now create a new notebook and run our Python programs over here with Jupyter notebook running. Now we can create a new Python notebook and run our programs in it. Click on the new button, choose Python 3 notebook. As you can see, this setup is very similar to the ones which we saw on the Google collab page. You can use either Jupyter notebook Google collab throughout this course. You'll be getting the same output. You don't have to worry about it. Now moving on, we would be starting with the very basics. As you know, NumPy is a Python library, which provides us multi-dimensional array objects. And with the help of these array objects, you can perform various mathematical operations. They may be logical, or it may be related to sorting or shape manipulation or etc. So now let's first import the NumPy package. Before using the NumPy library, we must first import it to our code, isn't it? Because if you do not import it, how will we use it? So to import this package, you need to write a simple one line command, namely import numpy as nb. You can rename this variable. You can name it anyway, you can name it as NumPy package or anything. But for simplicity, we usually use np. Now to run this code, you can either click on run. The moment you run it, you can see that the library is imported. Or you can use shift plus enter on your keyboard. Now, as you know, array is a simple data structure which contains objects. We'll first create a simple array and then convert it to NumPy array. Since you know NumPy provides a multi-dimensional array object, we can convert our arrays to a NumPy array and perform all the computations we need. Or instead, we can create our own NumPy array in the beginning and perform the computations. So first we'll create a simple array and we'll convert it to NumPy array in this module. So moving on, let me create a one-dimensional array, one-dimensional array. A two-dimensional array would be called as a matrix. You might be very well aware of that. Now, let me name my array as MyArray. And let me put some numbers, 12, 34, 43, 14, 51, 66. Now, if you want to print all the numbers that are present in this array, you can name the array My underscore array and press Shift Enter or the Run cell. I'll be pressing Shift Enter as it's easy. As you can see, we have printed the output. We have printed every number that was stored in this MyArray. Now, moving on, our main task in this module is to convert our simple array to a NumPy array. We can do that very easily using np.array and we will be putting the name of our array My underscore array. Check this. Since we imported the NumPy package as np, we are using the np package over here. If you give a different name to it, you'll be using a different name over here. Now, numpy.array means convert this array into a numpy array, and we are passing the array name. That is My underscore array. Now, let's run this cell. This array has been converted into a NumPy array. Now, see the difference. When I print MyArray, which is a simple array, our array of numbers that was stored in this array gets printed. But the moment it is converted to a NumPy array, you can see that there is a word added over here that is array, and then we get the entire list of numbers which were in our array. Now, you see this is an object. We have converted our simple array into a NumPy array. Similarly, this goes same for two dimensional array. Similarly, for two dimensional array. Let me name my two dimensional arrays My2DArray. It's easier to understand, isn't it? Now, let me fill in some elements in this, say 12, 34, and you can put in any numbers, 43, 14, and then say 51, whatever, 15, 66. Now, let me print this array My underscore 2D array. Now, our array has got printed over here. Now, I'll be converting this 2D array into a NumPy array. You very well know how to convert it. Let me show you once again NumPy array converting my 2D array. So you can see we have converted our 2D array that is a matrix into a NumPy array. So that's all in this module, we have seen through how to convert a simple array into a NumPy array. Now, in the next module, we will be discussing how to create a NumPy array, how to generate a NumPy array. In this one, we created a simple array and we converted it into a NumPy array. In the next one, we would be generating a NumPy array directly. So, see you in the next module. Welcome to this module. Now, here we will be discussing how to generate our NumPy arrays. Now, the first way of generating a NumPy array, say I want to generate a NumPy array, which is holding consecutive numbers. I will be using a range function. The function name is a range. I would be using this function to do that. First, let me write built-in methods to generate NumPy arrays. Now, since we are generating NumPy arrays directly, we would be using the NP keyword as we imported earlier. Now, NumPy array, a range. In this range function, I would be giving the lower limit and the upper limit of the range of values that I want to print. Say 0 to 10. Now, this function would be printing values from 0 to n minus 1, that is 9. It would be printing value from 0 to 9. If I consider the same function and say I put 0 to 20, it would be giving us the values from 0 to 19. I hope this part is clear and I hope you are following along with me. Now, for example, I want to print values. Now, for example, I want to print values that are not consecutive, but are having equal difference. In that case, I would be passing three parameters to this range function. That is, NP.arrange say 0 to 10 with a difference of 2. Every time the number increases. So, as you can see, we have printed a list of even numbers using the NumPy.arrange function providing three parameters. Basically, the first parameter is the start, the second parameter is the end and the third parameter is the step value. Now, we have discussed the first way of generating a NumPy array using a range function. The second way is using the line space function. This is the function line space. Now, the line space function prints a set of numbers that are equally spaced in an interval. Let us see NP.line space. Even this takes in three parameters for example, 0 to 10 and the third parameter would be the total numbers you want to print in this given interval. Those numbers would be equally spaced. For example, say I want to print 10 numbers. I will be running this code. Now, you can see there are 10 numbers over here. All of them are equally spaced. When we use this function, you can see after 0, it skips two values, goes to 2, then again it jumps to 4, then it jumps to 6. But in this case, it is generating 10 values in the third parameter. Here, the third parameter is used as a step value. But here, the third parameter is the total number of numbers in this interval. I hope you are not confused. Moving on, the third way of generating a NumPy array is NP.Zeros. Now, what this function would do is, this would generate an array of zeros. Now, it takes one or two parameters. When it takes one parameter, it would generate a 1D array. When it takes two parameters, it would generate a 2D array. For example, I put 8. This would be producing an array which would be having 8 numbers and all of them are zeros. Small error. Oh, there's a spelling mistake. Run this. As you can see, we have generated an array which is having 8 zeros. Similarly, it's complement that is NP.Once. This would generate an array which contains only once. And the array would obviously be a NumPy array. Running this, as you can see, we have generated an array which is consisting of 8 ones. Similarly, if I want to generate a 2D array of zeros, that is NP.Zeros, I would pass in the dimension of the array. That is, for example, I want a 3 cross 4 array which would be having 3 rows and 4 columns. And running this cell, you can see I have generated a 3 cross 4 2D array or we can say it has a matrix. Similarly, it applies for, similarly, it applies for the case of NP.Once. Now, moving on, say I want to generate an identity matrix. What is an identity matrix? Identity matrix is a matrix where all the diagonal elements are 1 and rest of the element are 0. I'll be using NP.I function, NP.I function. And the parameter that NP.I function would take is the total number of diagonal elements. Suppose I want 5 diagonal elements, then I'll put in 5 as the parameter and I'll run this cell. As you can see, 1, 2, 3, 4, 5. There are 5 ones in the diagonal of this identity matrix used to generate identity matrix. Now, going on, the next function is random function. With this function, you can generate random list of numbers. Now, to generate a random array using the random function, we'll type NP.random.rand. And here we would pass the dimension of the matrix. For example, I want a 4 cross 5 matrix. As you can see, it gives me a 4 cross 5 dimension matrix. You can even generate a 1D array with this. I have considered an example where I generated 2D array or namely a matrix. Suppose I want a 1D array, 1D array of random numbers. Then I'll pass only 1 parameter to generate a 2D array. I'll pass 2 parameters. So, I hope this is clear. Now, another way of generating an array or a matrix using the numpy package is using the random function. Now, this function returns normalized values. That is, NP.random.rand. And suppose I want an array which is having 4 numbers, it would be generating an array which is consisting of normalized values. For those who don't know what exactly normalization is, in simple words, a normal distribution is a distribution where the mean is 0 and the standard deviation is 1. Now, these numbers are part of standard normal distribution graph. Standard normal distribution graph is a bell-shaped curve. It's a bell-shaped curve. Now, the specialty of this graph is it allows us to make comparisons across infinitely many normal distributions that can possibly exist. A normal distribution has a mean of 0 and a standard deviation of 1. So, these values are actually the values that are generated from that bell-shaped graph. It gives out normalized values. Now, moving on, similarly, you can generate a 2D matrix using the random function. Now, if you want to generate a random integer function, then simple, we'll be using a randint function. NP.random.randint function. And now, for example, I want to generate 10 numbers from a range of 1 to 20. 1 to 20, I want to generate 10 numbers. I've given 3 parameters as you can see. Now, with this function, we would be getting 10 numbers from the given interval. Since it's a random function, if you run it, these values would change. Suppose I run it again, you can see the values are changing. Similar is the case with this. The values would be changing every time you run this cell. That is what random function does. Now, rand gives you values from 0 to 1. Randon gives you normalized values. randint gives you integer values. And all those values are random. They would be changing every time you run the cell. With this, we have completed this module. And in the next module, I would be discussing different methods that are used in NumPy arrays. Remember, in the first module, we discussed how to convert a normal array into a NumPy array. In the second module, we discussed how to generate a NumPy array directly. In the third module, we are going to discuss the different methods that we can use in the NumPy array. So, I hope this module is clear. And see you in the next module. Hello, everyone. Welcome to this module. In this module, we would be discussing the different methods associated with NumPy arrays, as well as the different array operations and mathematical functions that can be performed on a NumPy array. So, moving on, let us consider a NumPy array. And I would be filling that array with different integers or in other words, random integers. And I would be storing it in a variable named array. Let us see that. Let me consider 20 random integer values from 0 to 100. And let me run this cell and check. So, yeah, in this array, we are storing 20 random integer values that vary between the given intervals 0 to 100. Now, the first method that we are going to talk about is shape. Now, the shape method gives the dimension of the array. If you consider a 3 cross 2 matrix, then the shape of the 3 cross 2 matrix would be 3 comma 2. Similarly, for a 4 cross 1 matrix, it would be 4 comma 1. It would give you the dimension of the matrix for array. So, to find the shape of this array, we'll use the shape function. And you can see this is the shape of the given array. Now, for example, I want to change the dimension of this array. Or in other words, I want to reshape it. I want to change the dimension, then I would use the reshape function. For example, array reshape. And now I would be putting in the dimensions in which I want to reshape the given array. Now, the important point to note over here is, if there are, for example, if you consider a 1D array and there are 20 elements, then you can reshape that into a 4 cross 5 matrix or a 5 cross 4 matrix or a 10 cross 2 matrix or a 2 cross 10. Basically, the product of the dimension should be equal to the number of elements present in the matrix. Now, say if I want to reshape this array in 4 cross 5 matrix, then you can see I have converted this 1D array into a 4 cross 5 matrix. And obviously, this is a numpy 2D array. Similarly, if I try to reshape it in 10 comma 2 of dimension 10 comma 2, then you can see I can reshape it in this dimension. But now, for example, I want to reshape it in say 11 comma 3, then you can see this wouldn't be possible. You cannot reshape an array of size 20 into the shape 11 comma 3. Even the product of 11 and 3 would be 33, which wouldn't be equal to 20. Now, moving on, if you want to transpose this array, then you can simply add dot t function. For example, array, say I reshape this array in 4 comma 5 of dimension 4 comma 5 and I want to transpose this. I will simply add dot t. t stands for transpose of the matrix. So, when I run this cell, you can see the entire array has been transposed. Now, let me delete this, say, cut it, cut it. You can see the difference 4 comma 5 matrix and the transposed 4 comma 5 matrix. You can see what is the difference. Now, moving on to different array operations or mathematical functions that you can perform in your numpy array. Consider an array and say it stores a limit in the range 1 to 10. Let me run this cell. So, I forgot to put in a range 1 to 10. So, you can see that this is the array using the arrange function. And suppose my first function would be multiplication or namely the method. If I want to multiply each and every element of the array from itself and simply multiply the array with itself. In other words, this would give us the second power of every element. So, you can see 1 square, 1, 2 square, 4, 3 square, 9. Similarly, if I multiply it again, you see it would give you the cube of all the elements that were present in the numpy array. Now, similarly, you can divide, add or subtract from the array. Say array minus 4. Now, moving on, we can similarly divide or add and so on. Now, if you want to rise the element to a power, to a given power, for example, 4th power or 5th power, then you have to use two star symbols. For example, array double star 4th. This would raise each and every element present in the array to its 4th power. So, you can see each and every element has been raised to the 4th power. Hello, everyone. Welcome to the new module. In this module, we would be discussing some more functions that are associated with numpy. I hope you have been enjoying the course all along and solving the quizzes that I have given and learning out of it. So, moving on, let me create a new array. For example, array equal to numpy.arrange and giving it a range from 1 to 10. Running the cell, let me print the array and now the array has been printed. Now, let me consider a case where I have to find the square root of all the numbers that are present in the array. In that case, I would be using the square root function that is given by the numpy library. So, to find the square root, I will be using np.sqrt where sqrt stands for square root and I will pass array as the parameter array and I will print this. So, now you can see in the result, we have got the square root value of each and every number that was present in the array. 3 square equals 9 and similarly, 1 square equals 1. So, moving on to the next function, the next function is the max function. Now, we have this array which has numbers from 1 to 9. If I want to find the maximum number that is present in the array, now, it is obvious that in this case, the maximum number would be 9. But if say I had a huge array which has got multiple numbers, in that case, if I want to find the maximum value of a number, I would be using the max function and that would be written as np.max and again, this would be taking one parameter that would be the array that I have created. And let me run this cell. The maximum value is 9. If I consider an array having random integers that is array equal to np.random.randint and if I am specifying the range from say 1 to 100 with 30 random integers running this cell, I am running and printing the array. So, I have got a set of random integers, 30 random integers from the given range. If I want to find the maximum number from this, I will use np.max and pass array as the parameter. And now, you can see 97 is the maximum number that is present in this array having random integers. So, moving on. If we can find maximum number in an array, isn't it obvious that there would be a minimum function? So, I will be using np.min and I will pass array as the parameter and I will run this. So, the minimum value is 4. Our next function would be the rmax function. When I use the max function, it returns me the value of the maximum element present in the array. If I want to find the index of the maximum number that is present in the array, then I would be using rmax function. So, np.rmax and I will pass array as the parameter. And you can see the index of the maximum number, index of the maximum number is 4. Fourth index. So, if you have a look at the array, this is 0, first, second, third and fourth index. So, our maximum number is present in the fourth index. If I want to find the index of the minimum number, in that case I will be using rmin np.rmin and I will pass array as the parameter and I will run this, the first one that is 0 and first index. I hope this part is clear and we would be discussing some more functions. So, now the functions that would be discussing would be more oriented to mathematics. For example, finding sine or log or cos of a given number. So, moving on, we will first discuss about the log function. Now, consider I want to find the log value of each and every element that is present in my array. Okay, for that I would be simply using log function that is np.log and I will pass array as the parameter and I will run this. Now, you can see this would be giving me the log value of each and every number that is present in the array over here. Similarly, if I want to find the sine value of each and every number that is present in our numpy array, I will simply use the sine function that is np.sine and I will pass array as the parameter and I will run this. So, as you can see, I have got the sine value of each and every number that was present in the array. Similarly, you have got cos function, tan function. Okay, like np.cos and I will pass array. You get the cos value. If I put tan, you get the tan value. So, you can see that we can find the trigometric ratios of each and every number using numpy. Moving on, let me consider a 2D matrix now say array equal to np.random. I will fill in random normalized values in this two dimensional matrix. So, I will be putting a random n where n stands for normalization and let me say, let me make a 3 cross 4 matrix and I will print this. So, this is my matrix. Well, I will rename it as matrix. So, we have a 3 cross 4 matrix that is filled with values that are normalized. Now, if I want to round off all the elements that are present in this matrix to say a second decimal place up to two decimals or if I want to round this off up to three decimals, in that case, I can simply use round function. So, what I mean is np.round function and my first parameter would be the array or the matrix that I have created that is matrix and the second parameter would be the decimals up to which I want to round each and every number that is present in the matrix or array. I will be putting decimals equal to say I want to round this up to three decimal places. I will put three as the value and I will run this. So, you can see I have rounded the values that were present in this array up to three decimal places. So, now finally, if I want to find the data type of the matrix or one dimensional array, in that case, I would be using d-type function. Say, if I want to find the data type of this matrix, I will write matrix dot d-type. This will give me the data type of the entire matrix and I will run this function. So, it is float 64 which means I have got decimal values over here and decimal values are called float values in programming. So, I hope this part is clear and if you have any doubt, you can re-watch the entire video and practice and you can solve the questions that would be given as an assignment to you and it's okay to make mistakes because even when I was a beginner, I made a lot of mistakes and if you make any mistakes, learn from them, implement it and keep revising. Okay, until then, see you in the next module. Hello everyone, welcome to this module. Here we would be discussing indexing and comparison of NumPy arrays. So, starting on, let me consider an array which would contain elements from the range 1 to 10 that is np.arrange from 1 to 10 and let me run this cell. Now, as you can see, our array stores elements from 1 to 10 inclusive of 1 and exclusive of 10. Okay, now, suppose I want to show the element at fourth index of this NumPy array. In that case, I would write the fourth index. I would use the square brackets and put in four as my index number and this would show me this would show me the element present in the fourth index. Okay, you see, element in the fourth index is 5, 0, 1, 2, 3, 4. Fourth index element is 5. Moving on, if I want to show elements present in different indexes. Okay, in that case, I will be putting multiple index values. So, array, double brackets and I will be putting index values. For example, I want to see the element that is present in 0 index, fifth index and eighth index. I will be running this cell and you can see it returns me the value of numbers that are present in the respective indexes. Note that when I am putting in multiple indexes, then I am using two square brackets. Okay, be careful regarding that. Now, for example, I want to show elements from a range of indexes. Okay, then you need to use array. Suppose from 0 to fifth index, I want the values from 0 to fifth index present in the array. Then I will use this format and I will run this cell. It prints out all the integers that are present from 0 to fifth index. Okay, now moving on. Now see, I want to replace the values present in the indexes. Okay, in that case, say I want to replace the value present in the second index with four. Okay, and I run this cell and now I print the array. What would happen? I have replaced value present in the second index. Initially, what was the value present in the second index? 0, 1, 2, 3. The value was three. I have replaced that value with four. Okay, I hope this part is clear. Now, for example, I want to replace values from a range of indexes. Okay, in that case, similar to what we discussed over here, I would be using the same format here, that is array. Say from three to seven, I want to replace. In this case, I had print out the values that were present in the index. Now I would be replacing the element that are present in a range of indexes from here. Okay, in that case, suppose I want to replace all those elements with, say, this number and I run this cell and I print it. Now you can see I have replaced the following indexes with the numbers that I had in. Consider a two-dimensional matrix. That is, say I give it a name as array 2D and fill it with a range of elements starting from, say, 1 to 20. I want elements from 1 to 20. So I would be giving the following range 1 to 21. Since 21 would not be included. And let me reshape this into four cross five matrix. Okay, a range. And let me print the array 2D. So this is my following array that I have printed. Now, for example, when I considered the case of a one-dimensional array and if I had to show the elements from a given indexes, I use the following format. That is, I gave the index range from zero column to the index I wanted to show. If I consider that case, if I want to show elements in a 2D array, then I can use a similar format. But here, the case would be slightly different. It would take in two values, one for the row and other for the column. Say I take array 2D and I want to show all elements. I want to select all elements from the row. And I want to select the fourth and second column from the given 2D array. Then in that case, I would be giving 2,4 as an input. Okay, this indicates I have selected everything from the row. And this specifically indicates the row. And this specifically indicates the column number. Okay, and let me run this cell. It gives me the second and fourth column, including all the rows. This is first row, second row, third row, fourth row. And second column, fourth column. Zero, one, two, three, four. Second column and fourth column. And say, if I put in the row value as 1,2 and run this cell, comma 2, and I run this cell. So, you can see it would give me the specific value at the index specified over here. Now moving on to selection of different values in array and obviously copying the number array. So, first let me talk about selection. Let me consider a 1D array, a 1D number array, NP.arrange, which contains elements from 1 to 10, which means it will be having nine elements. Let me run this cell. So, this is my one-dimensional array. Now consider, if I want all the values that are less than 5, that means array less than 5. If I run this, it returns a Boolean value. When I put in this argument, okay. Now, if I want specified number instead of a Boolean value, then I will substitute the same thing in the array. I would be substituting this part into the index of the array. That is array of array less than 5, I would be substituting this value in the index part and I will run this cell. Now this would give me a list of numbers that are less than 5. If I put in less than or equal to 5, then it would return me 1,2,3,4,5. As you can see, now the last part of this model that I would be discussing is the copy function. Now say I replace the number presented at the third index with the following number, okay. And I run this cell and I print the array. You can see the number gets replaced. But the problem here is, suppose I wanted the original array, okay. Though I have replaced that specific element, I want array in my original form, in the earlier or previous form. Now it is not possible over here. So I can use the copy function to copy the elements of my predefined array. Now if I redefine this array, say array equal to np.arrange with 1,10 and I print the array. Now if I want to make any changes in the array, then it is always good to have a copy of the current version of the array. And then if you want to make any changes, you can make any changes in the given array, okay. But your original form would be preserved. For that, you can use the copy function. Say array underscore copy, underscore copy equal to array dot copy function, okay. And if I run this cell, if I run array underscore copy, you can see array underscore copy would be storing my original array. Now if I want to make any changes in this array, suppose the third index, I change it to this number. And I print the array. You can see this is the change array. Since I've already saved a copied version in the array underscore copy, I can successfully hold, I can have an earlier version of my array. So with this, we have completed this module. And in the next module, I would be discussing about the input, output operations. Until then, keep practicing. And if you have any doubts, you can rewatch the video. And let me see you in the next module. Hello, everyone. Welcome to the final module of this course, where I would be discussing about input and output operations in NumPy. And starting on, first, let me change my directory to the desktop. I'll be using cd command desktop. This would change my directory, working directory, into the desktop directory. Okay, and I'll run this cell. Now my directory has been changed to the desktop one. Okay. Now what exactly is input and output operations? For example, I have an array, and I want to save that array into a format in my local PC. Okay, in the hard disk. Okay, so there are different formats, I can save my array in binary format, or I can save my array in a text format, or I can save my array in a zip format. Okay, there are different formats to save your NumPy array. Similarly, once you have saved that array, you can even load that array. You can load that array, which was earlier saved in text form or binary form. Okay, so I will be discussing a few saving formats and leave the rest to your own discovery. Okay, so moving on, let me make an array that I have to save array to save. And let me give an arrange, arrange of 10. Okay, let me run this array. You can see I have stored numbers from one to nine. Now moving on, suppose I want to save this array in binary format. Okay, I want to save the array in binary format. In that case, I would be simply using np.save, np.save. Okay, and it will take two arguments. The first argument would be the file name that I have saved. And the second argument would be the array that I have saved. So let me rename the file as array underscore saved binary. Since it's saved in binary format, I'm considering that. Okay, and which array do I want to save the array to save? And now let me run this. Now, if you check my desktop, okay, the array has been saved in binary format. Point to be noted here is the extension, the extension of the file would be .npy. Okay, now say I want to run this with notepad, for example. So you can see binary file, it would be opening my binary file of this format. Okay, now the reason why this file is saved in desktop is I changed my directory to desktop earlier. Okay, otherwise the file would have been saved in the previous directory where I was working. Okay, so moving on, if I want to load that binary file that I have saved just now, I'll be using np.load function np.load. Okay, and I will be in I will be passing the first parameter as the file with which that was saved. The file name, okay, array underscore saved underscore binary. Okay, and the most important part over here is you need to put the extension as well, which was .npy and I run the command. I can see I'm loading the array that was saved just now over here. Okay, now the second way to save your array is as a text file, you can save your array as a text file. Okay, for example, I name the array as array to save. And let me initialize the array as np.range and with having 10 numbers. Now I want to save the array in a text file. Okay, for that case, I will be using np.save text, save txt. Here txt stands for text. And the first argument would be the name of the file, which would be saved in the text format, which let me name it as array underscore saved in say text format. And I would be including the file extension as well. And the second argument would be the name of the array that was array to save that I re initialized just here. Okay, and if you want, you can even place a delimiter. Okay, as a comma. Now, what exactly is a delimiter? Okay, delimiter is is used to separate is used to separate the values. Okay, and let me save this. Okay. And now I have saved that file if I go to my desktop and check over here, which is array underscore saved txt. And if I open this, you can see my array has been stored in the text format. Okay, so similar way, if I want to save my file in a zip format, I will be using dot save z function. Okay, there are different formats in which you can save your array. And if you want, you can reload it and use it when required. Okay, I'll leave that part to your own research. And and with this, we have completed our final module. I hope whatever we discuss over here, it has been clear. And if not, you can rewatch the whole video. I'll be sharing this to my notebook. Until then, I would suggest you to keep practicing, keep discovering and don't let the curiosity in you. Bye. Okay. So hello, everyone. First of all, I would like to congratulate each and every learner of this course. I hope you found this course very interesting. And you enjoyed your time learning this course. Learning NumPy is your first step on your own journey of becoming a data scientist. There are many libraries that come with Python, such as Matplotlib, TensorFlow, Pandas, Keras. So don't stop here. Libraries like TensorFlow, which is used in making machine learning models, Scikit-learn, which is used for data analysis, OpenCV, which is used in the field of computer vision. If you enjoyed learning this library, then as you move on, you're going to enjoy double or triple times of this. So don't let the curiosity in you die. There may be times where you might feel that you should just leave this and just go back to your old ways. But please, do not do that. That is the time when you put in your maximum effort, and it may not take a month or two to become a data scientist. It takes years to become an experienced and a professional data scientist. But that hunger of learning more would surely reduce your time reaching your goal. And please feel free to share your progress with me. I'll be the happiest person on earth to see your progress. And if you have any suggestions or any constructive comments related to this course, or if you want, or if you want courses that are related to the field of data science, then you can surely reach me from the resources section that I have provided in this course. And lastly, I would say, don't stop here, keep on learning, and remember, it's very normal to commit mistakes. Because if you do not commit any mistakes, then there wouldn't be any learning. So be proud if you make any mistakes and also rectify them, learn from them and try not to commit those again with such mentality, motive and perception, you will surely move ahead and become a successful data scientist. Until then, take care and keep moving forward.