‫Welcome back.
‫In this section, we're going to look at Num Pi.
‫And now I'm very excited about this section because Numb Pie is basically the backbone of all data science,
‫machine learning and numerical computing in Python.
‫And that's actually what NumPy stands for.
‫It stands for numerical python.
‫And what is NumPy?
‫Well, in all of machine learning, no matter what kind of data that you're working with now, this
‫could be a data frame like we saw in the previous section on pandas.
‫NumPy is going to form the foundation of turning your data into a series of numbers.
‫And then what a machine learning algorithm will do is work out the patterns in those numbers.
‫So if we refer back to our machine learning modelling framework, we've got step one as problem definition.
‫Step two is data evaluation features, modelling and experiments.
‫And then if we have a look at what tools we can use in this section, we're going to be focused on NumPy.
‫NumPy comes into the data analysis section, however, as you'll see in the future.
‫And what we just referenced before is that machine learning, although it's referred to as modelling,
‫is essentially taking data, turning it into numbers.
‫And in this case with NumPy, usually the form of a numpy array which will have plenty of experience
‫with after this section and then finding patterns in those numbers.
‫So almost across this entire pipeline, numpy will come into play.
‫Now why num pi?
‫Or the main reason we use numpy instead of pure python.
‫I mean, you can do numerical calculations in python, but usually if we want to do large scale numerical
‫calculations, we refer to num pi.
‫It's because it's fast.
‫And now the reason why it's fast is because behind the scenes there's optimizations written in C code.
‫The beautiful thing about the numpy package is that you can use these C code optimizations using pure
‫python.
‫That means you don't have to know C to be able to use numpy and python is a bit easier to write than
‫pure C.
‫So that's the advantage of using NumPy.
‫Now it gets these optimizations in speed through a process called vector ization via a term numpy uses
‫called broadcasting, which is essentially just avoiding writing loops when you're writing calculations.
‫Because if you're writing loops to make calculations such as in Python to calculate over a list that
‫can form some eventual slowdowns, if you have a list, say, of, of millions of different numbers,
‫which becomes common practice when we're working on machine learning projects.
‫And as we mentioned before, NumPy is the backbone of other Python scientific packages.
‫Now, PI actually forms the basis of the PANDAS package.
‫So what are we going to cover in this section?
‫Well, of course, we're always going to be focused on the most useful functions, the ones that you
‫can start using straight away.
‫We'll have a look at different numpy data types and attributes of those data types.
‫Now, the main one is an NDI array, but we'll have a look at that in another video.
‫We'll look at how to create a raise, a race you can think of as a list of numbers.
‫We'll have a look at how to view arrays and matrices now, a matrix or a matrices.
‫You can imagine as a combination of different arrays.
‫We'll then look at how to manipulate and compare arrays.
‫We'll then finish out with sorting arrays, which is sorting out different lists of numbers, and then
‫some practical use cases of where arrays get used or where numpy can be used to turn data into lists
‫of numbers.
‫Sorry.
‫Where can you get help if you get stuck?
‫Well, the steps you want to try and follow is to follow along with the code.
‫So as we're going through the video, as we're working through our Jupyter Notebook, through the introduction
‫to NumPy lessons, you want to follow along as best you can.
‫Now, if you can't keep pace or if I'm going too fast, that's alright.
‫Feel free to stop it.
‫Go back, practice something on your own.
‫But you should be practicing writing the code and running it as much as possible.
‫So that's step two.
‫Try it for yourself.
‫Try to run the code.
‫Remember the saying If in doubt, run the code.
‫If you get stuck on a certain function or a certain thing that we've covered, you can try to search
‫for it here.
‫You'll probably come across StackOverflow or the official numpy documentation.
‫Then after that, once you've searched for it, if you find something on StackOverflow or the numpy
‫documentation, the important thing is to keep trying again into the code that you find in the Jupyter
‫Notebook.
‫Practice running it.
‫If in doubt, run the code.
‫And then finally, if you're still stuck, don't forget you can always ask for help.
‫There's no such thing as a stupid question because if you have a question, it's likely someone else
‫has the same question you can ask on StackOverflow or in any other resource you can find.
‫All right.
‫With that being said, that's an introduction of numpy.
‫It's the foundation.
‫It's the backbone of other data science and scientific packages.
‫But let's get in and code.
‫Let's see what it's all about.