Locked lesson.
About this lesson
Before we start coding with Numpy, let's discuss what it does and how it works. This video will help you understand why Numpy is so important for data analysis.
Exercise files
Download this lesson’s related exercise files.
Numpy Overview - What is it used for.docx57.1 KB Numpy Overview - What is it used for - Solution.docx
55.4 KB
Quick reference
Numpy Overview - What is it used for
The Numpy Array is the workhorse of Numpy. It is similar to a Python List, and is used to handle data.
When to use
We'll use Numpy Arrays directly and indirectly throughout the rest of the course to deal with all of our data.
Instructions
Numpy arrays are the work horse of Numpy, and Numpy is used by many other data analysis tools such as Pandas, Scipy, and Scikit-Learn.
Hints & tips
- Numpy Arrays look like this: np.array([])
- Numpy Arrays are Faster than regular Python Lists
- 00:05 Okay, so we've installed NumPy, we've got it imported into our program,
- 00:09 here into our data Jupyter Notebook.
- 00:11 Now, before we start learning actually how to use it,
- 00:14 which we're going to do in the next video, I want to spend just a minute or
- 00:17 two talking about what it is and why it's important.
- 00:20 So NumPy stands for numerical Python.
- 00:23 It just does what it says, it deals with numbers, it deals with data.
- 00:27 So we're learning data analysis, the cornerstone of data analysis is data,
- 00:31 big groups of numbers, right?
- 00:33 NumPy handles those numbers.
- 00:36 And it does it, using primarily something called a NumPy array, and
- 00:40 a NumPy array is just np.array and then your NumPy array.
- 00:47 And we'll talk about this in the next video, but primarily,
- 00:50 this is all a NumPy array is.
- 00:52 Now, throughout the rest of this course we're going to be spending a lot of time
- 00:56 learning about something called Pandas.
- 00:58 And that's where we're going to have the most fun,
- 01:00 that's where we're going to do the most cool, interesting things.
- 01:03 But Pandas like so many things with Python and data analysis, relies on NumPy
- 01:09 behind the scenes to be the real workhorse to really handle the data itself.
- 01:16 And that's why NumPy is so important.
- 01:18 And a lot of times people kind of gloss over NumPy, right?
- 01:21 Because it's not that exciting, it's just handling the data, right?
- 01:24 That's not fun, we want to do stuff with the data.
- 01:27 And we use other things for that like Pandas.
- 01:30 But handling the data is important too, and the more you learn about Numpy,
- 01:35 the stronger you're going to be at data analysis with
- 01:38 every other tool that we use, Pandas, Scikit-learn, everything else, right?
- 01:42 So resist the urge to kind of skip over this section with NumPy stuff, right?
- 01:47 I know it's not that exciting but this is important, and
- 01:51 the better grasp you have on this, the more it is sort of instinctual, right?
- 01:56 The less you have to think about it,
- 01:57 the more you just know it, the better off you're going to be in the long run.
- 02:00 So like I said, the cornerstone of NumPy is something called a NumPy array.
- 02:05 And we'll really look at these in the next video, but
- 02:08 a NumPy array is basically just an array.
- 02:11 And if you're familiar with Python, you already deal with arrays,
- 02:14 Python calls them lists.
- 02:16 So I don't want to get into much details in this video,
- 02:19 I just want to introduce what NumPy is and why it's important.
- 02:22 When you think NumPy, think arrays,
- 02:25 think large amounts of data, NumPy is going to handle that stuff.
- 02:29 And the reason why we use NumPy arrays versus just a Python list is
- 02:33 NumPy is created with C programming language which is super, super fast, and
- 02:37 it can handle large amounts of data faster than a regular Python list would.
- 02:42 So that's really why we we like NumPy when we get right down to it.
- 02:47 So like I said, not the most interesting thing in the world but
- 02:50 super important and without further ado, let's just dive in here and
- 02:54 start playing around with this, because it is kind of fun.
- 02:57 I like to say that it's not that fun but I'm a geek and I like this stuff,
- 03:01 so it is fun to me.
- 03:02 So in the next video, we'll jump in and we'll learn how to use NumPy arrays,
- 03:05 we'll start playing around with them and that'll be in the next video.
Lesson notes are only available for subscribers.