NumPy Crash Course - Complete Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys welcome to a new tutorial today we will be doing a full numpy crash course that shows you all the essential functions of numpy numpy is the core library for scientific computing in python so if you do data science or machine learning this is a must know now let me give you a small overview what we cover today i'll link all those chapters with timestamps in the description below the video so if you just want to look up a particular use case feel free to skip to that part so we'll start with a little numper introduction and after that we jump right to the code and do a hands-on tutorial so we cover array basics then we will have a look at the difference between numpy arrays and python lists then we cover the dot product because this is a very common use case then we do a speed test between numpy arrays and python lists then we cover multi-dimensional or also called nd arrays we see how we can do array indexing and slicing and also boolean indexing then we talk about reshaping and concatenation of arrays then we have a look at broadcasting so broadcasting is a powerful mechanism that allows numpy to work with arrays of different shape then we have a look at different data science functions and axis then adds different data types at copying arrays how we can generate arrays how we can work with random numbers in numpy then we have a look at linear algebra in specific the numpy lin arc module for example we cover eigenvalues and solving linear systems and as last point we have a look how we can load data from csv files into numpy just a small note before we start if you find this tutorial helpful please hit the like button and consider subscribing to the channel this means a lot to me and helps me to continue with such free tutorials for you thanks let's have a look at numpy so numpy is the core library for scientific computing in python so it is essential if you want to do anything with data science machine learning or deep learning and it's also the core package for a lot of the popular machine learning libraries that you might know for example it's the core of psychic learn matplotlib penders and many more now the central object in numpy is the multi-dimensional array so numpy provides a high performance nd array object that allows operations really fast and it also provides all the tools for mathematical operations with these arrays and as a side note so a lot of the code of numpy is written in c and then the python functions are just wrappers around these c modules and this is one of the reasons why numpy is so fast so here are some of the use cases so as i said the central object is the array so we do a lot of array or matrix operations and linear algebra here we see for example a 1d array a 2d array and a 3d array and common operations that we do are for example the dot product matrix multiplications solving linear systems calculating the inverse or the determinant then working with eigenvectors and random random numbers and also when we work with images these are represented as nd arrays a lot of the times all right so now enough of the theory now let's jump straight to the code so first of all if you want to install numpy then of course you can do it with pip so you can do pip install numpy or you can also if you're working with anaconda then you can do conda install numpy both of them work fine and also if you install libraries like matplotlib or pandas then this will be installed automatically as well because it's in the requirements now let's go to the code so the first thing we want to do is to of course import numpy and we say import numpy snp this is just a convention how i think everybody is importing it and now the first thing that we can do is to check the version so we can print numpy dot and then underscore version and now if we run this then we see we see 1.19.1 is at the time of this video the latest version of numpy now let's create an array so we say a equals numpy array and then here we can put in a list so for example one two and three and now let's print this array then we see it down here so it has only one dimension in this case and for example we can analyze this array by saying a dot shape this is a very popular method that we want to check a lot of the times and this will return a tuple and here we say it only has one dimension with three elements what we also can check is print array dot data type and in this case it can automatically determine the data type so in this case it's in 64. we will talk about data types in detail more later for now let's also have a look at print array number of dimensions so here this is only one dimension then we can also have a look at the array dot size this will return the total number of elements so for example if we have an a fourth element then this will print four and as a last thing we can check the item size so let's say print a dot item size this will return the size in bytes of each element so here as we see the data type is in 64. so each element here has 64 bits or 8 bytes that's why we see eight here and then of course we can access different elements the same with as we're doing it with lists so we can say a and then the index zero this will print the first element so the 1 we can of course also access and assign values to elements so we can say a index 0 equals 10 for example and then if we print our array again then we see that the first element is now a 10. then we can also do mathematical operations and these work element wise most of the time so if we create another array by saying b equals a and then times and then another array and here let's put in an array of the same size so let's do two zero and two and let's remove this and then we see all of these elements gets multiplied with each other so 1 times 2 2 times 0 and 3 times 2 so let's print b and then we see the result here so we talk about more of those mathematical operations later now let's talk about the difference between python lists and arrays so we can create a python list by saying l equals one two three and we can create a numpy array by saying numpy array and then pass in a list so one two three and now if we print both our list and our numpy array then they look the same at first glance but there are a lot of differences for example um now let's try adding a element to our list so we can do this by saying l dot append 4 and now if we print our list then we see it now has four elements so now let's try the same thing with our array l dot append 4 and then this will raise an error our numpy object has no attribute append so it doesn't work this way so let's have another way of appending a element so for our list we can do l equals our list and then plus another list with one item so this works so if we run this then we see again our list has four elements and now let's do the same with our array so we say a equals a plus and then let's do numpy array and a 4 and let's have a look at the result so now we see our array still has three elements and it's added four to each of those elements so one plus four is five two plus four is six and three plus 4 is 7. so this operation works significantly different on arrays and by the way this method is called broadcasting which will cover later so technically correct would be to use an array of the same size so here four four four this will return the same result but numpy is clever enough to also use this and then do it the same way now let's have a look at multiplication so if we say our python list times equals 2 and print our list then we see that it repeated our list and if we do the same with our um numpy array so a times 2 and print our array again then we see that it multiplied two to each of the elements so now i think we already get a feeling how of mathematical operations were in numpy so functions or operations to an array usually operate element-wise and this is an essential thing that we should know here that they work element-wise for example we can also have a look at other methods so for example we can apply the square root to our a and print our a then we also see that it applied so sorry i have to assign it again and we print it and we also see it still has the same size and it applied the root the square root to each of the elements same for example if i say numpy lock so the logarithmic also operates element wise and we will cover these operations more in detail now let's have a quick look at the dot product because it is so popular in data science and machine learning tasks to calculate the dot product of vectors so let's say we want to do it in python with our list what we want to do is so the dot product is the sum of the products of the corresponding entries so if we say let's say we have one two lists l1 and l2 equals another list four five six now what we have to do is to create a variable to hold the result so our dot product equals zero in the beginning then we loop over all the arrays so we say for i in range length l one for example and then we do our dot plus equals the multiplication of each corresponding element so l one of i times l two of i and then if we print the dot then this works but this is of course very cumbersome so in numpa it's a lot easier so first of all we can create two arrays by passing in the list so we can say l1 and doing the same with l2 and then we can calculate it in one line so we can say our dots equals numpy dots and then a1 and a2 and then if we print our dot then we see we get the same result but a lot faster and with a lot of less code so this works and now as a practice let's do it step by step manually too so for example we could also say dot equals a 1 times a 2 so this works element wise so the same as here and then we can say our dot equals the numpy sum over this dot so better let's call it sum here and we can't use sum so let's just use sum one and then some one and now if we print our dot again then we see this also gets the correct result and by the way all of those methods typically are also instance methods so we can call them directly on the array object so we can compute it like this we can do a 1 times a2 this is a array again and then call dot sum and without an argument and now if we print this then this works too and in newer versions there's also the syntax to use the add sign so if we say a1 and then at a2 and print our dots then this also creates the dot product so i think you should remember this syntax because you might see it a lot and then also this method of course and these are just the manual ways that i showed you so this is how we create the dot product now let's do a quick speed test and compare numpy arrays and lists and for this i already wrote some code here so i generate some random numbers then i will have the random objects as numpy arrays and as python lists and by the way you can convert a numpy array back to a list by calling the list function and of course you can also do it the other way around you can create a numpy array by creating it from a list and then i have two different dot product functions so the one which i just showed you is to do it manually with a for loop and then um do it with our python lists and the second one is just to do it in one line with our numpy arrays then we do we calculate this dot product a thousand times and we measure how long it takes with python lists and how long it takes with numpy arrays and then we print both of the times and also the ratio so let's run it and then we see list calculation took this long with numpy arrays it only took this long so numpy was 138 times faster so now let's run it again and again we see the ratio is 191 so again a lot of times faster so this is one thing that you should remember working with numpy arrays and doing mathematical operations usually is a lot faster than with python lists alright so now let's talk about multi-dimensional arrays or nd arrays so if we have a array and let's create it by like we did in the beginning when we only pass in one list so if we print our a then we see it only has one row and if we check the shape then we see it has only one dimension here so if we want to have multi-dimensional arrays we can pass in a list of lists so we do the first list and then use a second list and now if we have this and print this then we see this is a two dimensional array and we see now the shape is two by two and the first number is always the number of rows and the second one is the number of columns so if we put in some more elements in here then this is two by three so now it has three columns and now if we want to access elements so if we say a zero this will access the first row so it will print 1 2 and 6. now if you put in another index so 0 0 then this will access row one and column one so it will print the one and by the way there is a shorter syntax so we can do it with only one um bracket and then say our first index comma our second index so this will return one as well then let's quickly talk about slicing we will cover this later in more detail so for example if you want to have all the rows in column zero then we can use a colon so we want all the rows and then only column zero so this will return one and three and notice that the result is of rank one again and if we do it the other way around if we only say zero so row zero and then comma and then colon then it will print the whole first row another typical operation that we can do with nd arrays is to transpose it so we can say a dot t this will transpose our array then we can also calculate the inverse of our array by using the numpy lin arc module so we say np dot lin ark dot inverse of a and now i think if i run this we will get an error because our array must be square so let's make a square array again so two by two and now if we run it then this works then we can also calculate the determinant so by calling linux.that and then this will calculate the determinant of our array then we can also calculate the diagonal matrix by calling np dot diag of a and if we pass in a array then it will return the diagonal elements so one and four so this is again a 1d vector so if we assign this to a variable c equals this and then if we pass in a 1d vector to our diag function then this will return a diagonal matrix where it only puts in these elements and the rest is zero so this is an overloaded function that can have two different use cases now let's talk about slicing again so i already showed it a little bit so slicing is similar to python lists where we can slice our indices and since arrays may be multi-dimensional we must specify a slice for each dimension of the array so for example here we have our initial array and if we want to have only one value then we can do it by integer array in the indexing by saying b equals a and then for each dimension we put in the integers so for example 0 and 1 so in row zero and column one so this will print up the two this is how indexing works and now slicing um let's put in some more elements so one two three and also four and then here five six seven eight and if we want to have only row zero then we put in a 0 here for row 0 and then for the next dimension we use a colon and this will do from start to end and of course we can also put in the start and the stop value so from 1 to 3 and the last index is excluded so it only takes index 1 and two so these ones and if you want to have columns we can do it the other way around so we can say all the rows and then comma and then the columns we want so in this case we want only column zero or we want only column one and we can also use negative indices so we can start from minus one so minus one and minus one so this will start from the last index so here we have the last row and the last column for example if we put in a 2 here then we still have the last row and the second last column so it's the 7. so next to integer indexing we can also use spooling indexing for example let's create a two-dimensional array so a list of lists and here let's use for example one and two and another list three and four and another list five and six and now if we print this then it looks like this so it's three by two and now for example we can evaluate a boolean condition by saying let's say bool index equals a grader 2 and now if we print our pool index then this has the same shape and contains false or true depending on this condition so one or two both are not greater than two that's why we see false here and for all the other elements it's true and now if we apply this array to our original array again by indexing it with the full index and if we print this then we see we only get those elements where this is true so we only get three four five and six and notice that this is of rank one so it's only a 1d array again so this is important to remember and now of course instead of doing it in two steps we can also do it in one step by simply saying a and then the index where a is greater than two this will return the same thing three four five and six and now if you want to have a array that still has the same size what we can do is we can use the numpy dot where method and then we say where and the condition a grader 2 where this is true and we still just use the values of a and otherwise for example let's put a -1 and now if we print b then we see we now have an array of the same shape and for all those positions where this is not true we put in a minus one then we can also use what is so-called fancy indexing so we can access multiple indices at once so let's say let's create a numpy array and put in some numbers let's say 10 19 30 41 50 61 and now let's print our a first and now um so this will print our array and now let's create another array just with some indices so let's say our b equals and then for example we can also use a python list and then numpy is clever enough to figure this out so here we can say one three and five and then if we print our a with indices of this list then we see it only prints those indices so 19 so index one index three and index five so this is called fancy indexing and this is actually a common use case in real world code so a lot of time you have some array and then you want to filter it and for this you create some other array and then do some calculations and figure out the indices where this is true and then apply it to the original array so for example in this dummy example let's figure out the even numbers so we can get the even indices by using a function that is called numpy arc where and then we say a modulo 2 equals equals zero so all the even numbers and then we flatten our array so this should be only one d and then we apply it to our a array so a and then this new array then this will print out all the even numbers so this is a common use case in real world code now let's talk about reshaping arrays so for example we can create an array by using the arrange function and then put in 1 and 7 this will create a 1d array with the numbers from one to six and if we have a look at print a dot shape then we see it's only one dimension with six elements now we can reshape it by using let's say b equals a dot reshape and then we must put in a two pulse so let's say two by three and now if we sorry now if we print our b then we see it now has two rows and three columns so if we print b dot shape then we would see a tuple of two and three and by the way this will return an error if the shape cannot be used so for example if i use two by four then this will return a value error cannot reshape of size six into shape two by four so keep that in mind and we can also do it the other way around so three by two then we have three rows and two columns then there's also a method that is called new axis and this is used to create a new axis in the data and that's needed for example when your machine learning model or your model requires the data to be shaped in a certain manner and for example here our shape is only one dimension and we can add a dimension by saying b equals and then we use a and then if we want to add a new axis in the first axis then we say here numpy new axis and then comma and then a colon and now if we print b then we see we have here we can see a list of lists so now if we print the shape then we see this is now of size one by six and of course we can also do it the other way around so we can use a colon here and then numpy new axis and now if we print the shape then it's six by one so now if we print the actual array we see we have six rows and only one element in each row so this is a very useful method if your model requires the data in a certain shape now let's talk about concatenation so in the beginning we saw that in numpy arrays it's different than with python lists we cannot just say plus equals some list because then it will do element wise operations and now if we actually want to append element elements we can still do that but it's a little bit different so here let's create a numpy array and let's use for example again an array of array one two and another one three four and now let's print this first again and let's say we want to we have a second numpy array and this is also a list of lists and then here use only one list five and six and now if you want to put them together we can say c equals and then numpy dot concatenate and then as a tuple here it needs a and b and now if we print c and by default this added it as a new row so along axis one so it has a another optional argument axis and by default this is zero so if you run this then this will do the same thing but we can also for example say axis equals none and then if you have a look at the result then it's just a flattened 1d array where it appended all those elements and now if we put in axis equals 1 then this will be a value error because the dimensions do not match so for this we could transpose our b so we say b dot t and then if we run it then we see now it added the dimensions again and now as another column so this is one way and then there's also the h stack and v stack so for example let's create two new arrays a equals numpy array and then let's say one two three four and let's do another one b equals five six seven eight and now we can use h stack this will stack the arrays in sequence horizontally so column wise so let's say c equals numpy dot h stack and this needs a tuple so a and b and now if we print our c then we see it stacked it horizontally so one column after the other and then of course we also have the v stack so vertically so if we apply v stack then it adds the new array as a new row and yeah these are the methods how we can concatenate arrays so now let's talk about broadcasting so i already showed this in the beginning and again broadcasting is a powerful mechanism that allows numpy to work with areas of different shapes when performing arithmetic operations so i think you already noticed that we have to be careful with the correct shapes otherwise we will get value errors and now let's say for example we have a large array numpy dot array and then here we have a list of lists one two three and another list let's say four five six and let's copy and paste this and now let's say we have a new vector a equals numpy array and this has only three elements zero one zero one and now we want to add these elements to all the different columns so technically correct would be that we also have four rows here so like the same shape as here but numpy is intelli intelligent in this case so if we create another vector or another array y equals x plus a and if we print our y then this is working so now we see it added one to this zero to this and one to this and then the same for the next row and for the next and so on so this is called broadcasting and this is very powerful so in this case we don't need to have all the the dimensions like so so we can omit this and then numpy can figure this out for us now let's talk about some data science functions and the different axes so for example let's create a new array again so let's say uh 7 8 9 10 11 12 13 and then another array here let's start by 17 18 19 20 21 22 23 and now for example let's first again print this and here we get the type error because here this of course must be a list of lists so now print this and now for example let's calculate the sum of this so we can do this by saying a dot sum and this will calculate the overall sum and as we already seen we can also use the optional parameter axis so in this case none is the default which will calculate the overall sum and we can also use axis 0 which will calculate it along the rows so this means we get one sum entry for each column so here it will say seven plus seventeen eight plus eighteen nine plus 19 and so on and if we do it along axis one then it will calculate it along the columns so we get one sum entry for each row so now we get two entries so this is 70 is the sum over these values and 140 is the sum over these values so this is also very important to keep in mind always be careful which axis you are using and um for example we can also use the mean so this will now calculate the mean over all columns and if we use index zero then it will do it for each column and if you use axis none then it will calculate the overall mean so only one entry and for example some more data science function some more data science functions are the variance by calling a dot var then also the standard deviation a dot std and by the way as i said you can use this as instant method or you can use it as numpy and then std and then you have to use your array and then axis equals none this will do the same thing and of course you also have things like the minimum or the maximum values so here it see we see the minimum is seven the maximum is 23 so these are some helpful functions to do some data science now let's have a look at different data types so if we create a numpy array and don't specify the data type then numpy can figure it out on its own so for example now if we print x and print x dots data type then we see this is an in 64 in this case so an integer with 64 bits or 8 bytes we can also for example if we use a float here then numpy automatically knows that this is a float64 and of course we can force the data type by passing in the data type as arguments so for example here we can say data type equals numpy dot data type sorry numpy dot int 64 then it's still an integer even though we used float numbers here and of course we can also use int 32 when we don't need so many bytes so then we only have four bytes in this case so i recommend checking out the numpy documentation to have a look at all the available data types for example we can have float 32 float 16 and i think even float eight ah sorry no float eight is not available but float sixteen should be available so yeah so this is actually a very common beginner mistake that you have the wrong data type in your array and then your model assumes another data type and then it will raise a value error so if you want to fix that error just pass in the correct data type and a lot of times i think float 64 or float 32 should be good for your model now let's talk about copying arrays so here we have to be careful let's say we have an array with some numbers one two and three and now if you make a copy by saying b equals a and then if we modify b by saying b index 0 equals 42 now if we print b then the first entry has 42 but now if we also print a then you might be surprised because a also has 42 as first value and this is because here we only copied the reference and now both objects still point to the same location in the memory and this is why it modifies both arrays here so we have to really be careful in this case if we want to have an actual copy then we can say a dot copy and now if we print b and a then we see that a is still the same as in the beginning now let's talk about generating data or generating arrays so there are some methods to initialize arrays so for example very popular is to use numpy zeros and then as a tuple the size let's say two by three and now if you print our a then this is an array full of zeros with this shape um then of course there's also numpy once which is doing the same thing but filling it only with once and as you might notice the default data type here is a is a float so let's print a dot data type then we see this is a float 64. now if you want to have specific values we can do this by saying a equals numpy full and then the shape 2 by 3 and then the value let's say 5.0 and now if we print this we have an array of this shape all filled with fives then we can get the identity matrix by calling numpy dot i and this only gets the shape so this will uh create the identity matrix sorry this only gets one argument so let's say three and then it will return a three by three matrix where the diagonal is filled with once and the rest is zero then we also already have seen the arrange method so numpy a range and then a number so now if you print our a this will be a one-dimensional array from 0 to 19 and what's also helpful is the so-called linspace function so linspace this will get the start and the stop and then the number of steps so now this includes um [Music] if we have a look it is this array so this includes the start value as first entry and then the stop value as last entry and then make sure that we get five elements so all of those numbers in between are equally spaced so numpy linspace is a very handy method if you need to create equally spaced arrays now let's talk about random numbers so we can also generate arrays with filled with random numbers by using numpy.random random and then we need a tuple as the size and now this will generate an array with random numbers from the uniform distribution so between 0 and 1 then there's also the so-called gaussian or normal distribution so here we have mean 1 and 0 variance so we get this by calling numpy random rants n and now here we have to be careful because this doesn't take a two plus shape but each dimension as a separate argument so here we have to be careful so this is the normal or gau shin distribution for example if we generate a 1d array so with a lot of elements and then print a dot mean and a dot variance then we see this is almost zero and variance almost one then there's also a function to generate random integers so we get this by using np random and then rant ins and here we can use the start and the stop value and then a size equals a tuple let's say three by three and now if we print a then a has size three by three and random integers between three and nine and the ten is excluded so if we put in two numbers then it has the lower and the upper bound and if we only put in one number then it uses 0 as the lower bound and 10 as the upper bound so now here we see it also has 0 or 2 in it then when we want to get a random choice we can get this by saying a equals numpy random choice and then an integer and a size equals let's only use 10 and now if we print our a then we see it generates an array with this size and randomly choices elements between zero and this number so we can use it with a single integer parameter here but we can also use it with a list so let's say for example minus 8 minus 7 and minus 6 then it randomly takes elements from these possible values and now if we print our a then it might look like this now let's talk a little bit more about the linux module so for example how we calculate eigenvalues with this so eigenvalues are for example neither if you do machine learning and apply the pca algorithm or principal component analysis so let's create a new array and let's use a list of lists one and two and three and four and then we get the eigenvalues and the eigenvectors by get by calling the lin ark dot ike function and passing in a so if we print the eigen values then we see we get the two eigenvalues because this is a two by two matrix and now if we print the eigenvectors eigenvectors then we see we get two eigenvectors and here we have to be careful because this is a column vector this means that column zero corresponds to the eigenvalues zero so we can verify this by using the equation the eigenvector times the eigenvalue equals a matrix times the eigenvector this is the definition of eigenvalues so now if we say our first one let's say b equals and then we use eigenvectors and now we know this is a column vector so we want to have all the rows and only column zero and then times the first eigenvector so eigenvalues of zero now if we print this um we see this result and this should be the same as if we copy this and multiply our eigenvector with our array and we multiply this and we learned in the beginning we can use the add sign so now if we print b again and then this is incorrect because we have to do it the other way around sorry about that so we have to do it this way and then we see this is the same results and by the way we can verify this by using let's say let's call this c and now if we print d eq b equals equals c then um we get true and false so this is surprising because we see these have the same values if it's printed so and now if we evaluate it like this then it evaluates each dimension separately and here we run into some numerical issues so this is actually not the correct way to compare it so to compare the values what we actually want to call is numpy dot all close and then we use b and c so now if we print this then this returns true so this is also very useful to know when we want to compare two arrays if they are equal then use the numpy all close function now let's talk about solving linear systems and let's use a real world example so the question is the admission fee at a small fare is a dollar fifty for children and four dollar for adults on a certain day twenty two hundred people enter the fair and five thousand fifty dollars is collected and now the question is how many children and how many adults attended so this is a typically linear system where we have two unknowns and we also can make two equations so we can say x one plus x two equals twenty two hundred and then we also can say point five times x one plus four times x two equals five thousand fifty so x two is the number of adults and x one is the number of children so we can also write this in mathematical formulation so here our x the unknown equals a vector x1 and x2 then our a our matrix or nd array has the entries one and one so here one and one and then in the second row point five and four and then our b equals the result 2200 and 5050. so now if we write this as a linear system then we have the formula a times x equals b and now if we want to solve this for x then we have to compute the inverse of a which i already showed you what we can do with the lin arc module so the inverse of a times b so this is how we can solve it so now if you jump back to the code and do this manually so first let me show you the manual way and then let me show you another method which is better so first let's create our array a equals numpy array and then if you remember a list of lists and in the first row we have one and one and in the second one we have 1.5 and 4.0 this is our a and our b equals and then numpy array and then only one dimension and here we put in 2200 and 5050 so now we can say our x equals the inverse of a times b so we say numpy dot lin ark dot inf of a and then times b so the dot product with b and now if we print x then sorry this is a small x and now if we print x then we see the results and if you double check the math then you see this is correct but actually this is not the best way to solve it because using the inverse is actually it's a little bit slow and it it's also not perfect because then you run into some numerical issues so a better way is to use the numpy linux solve function so here we say x equals numpy lin arc dot solve and then a and b and then if we print our x then this has the same result but this is the preferred way and now you see it's that simple to solve linear equations you just have to be careful to create the correct arrays a and b and then you apply this function and get the result now the last thing let's talk about how we can load data from csv files into numpy arrays and for this i have a file in the same folder this is the popular spam based data set and basically there are two functions that we can use in numpy this is numpy lot load txt and numpy chen from txt so both are similar and both usually work fine i prefer the later one because it offers a little bit more options for your parameters but basically what you have to do is we have to say data equals and then we can say numpy load txt and then the file name so this is called spam base dot csv then we also have to use the delimiter which in this case is a comma so we use a string and then a comma and then it's also good practice to also already include the data type so here we say data type equals numpy dot float 32 and then this should work so now we have see if we print the data then this will print a large array so let's only print data dot shape and then we should see the shape of this array so this is working and the same with numpy dot gen from text then we also get the same shape so both methods are fine if you want to have a more detailed look into these functions then i have a whole tutorial about loading data and i will link it in the description so you can check it out but basically you can use these functions and then you can for example start applying them to your machine learning model and doing your training so yeah that's all i wanted to show you for numpy these are all the essential functions or most of them that you should know and if you want to learn more then i always recommend to check out the official documentation there you find even more useful methods but for now i think we covered a lot and you should be ready to go and to work with numpy and yeah i hope you enjoyed this tutorial if you enjoyed it then please hit the like button and subscribe to the channel and see you next time bye
Info
Channel: Python Engineer
Views: 51,069
Rating: undefined out of 5
Keywords: Python, numpy, tutorial, crash course, numpy tutorial
Id: 9JUAPgtkKpI
Channel Id: undefined
Length: 62min 44sec (3764 seconds)
Published: Sun Aug 09 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.