After meeting the Pandas Series data structure, it’s time to get more information about Pandas DataFrame data structure. You’ll learn how to build a Pandas DataFrame based on the Series you defined in the last video.
Working With Pandas DataFrames
Maybe we will vary the numbering here, but it’s going to be something along those lines. We’re going to do
10 of those, just so we can get a… And this one will be, let’s say, between
10. And then for the next one, what we’ll end up doing is something like this…
data2, it’s equal to something similar.
DataFrame() takes a dictionary of objects, so we can create a
DataFrame like so. It can be JSON, they have all these convenience methods that allow you to consume all kinds of stuff.
.from_csv(), all types of stuff.
But if you give it a dictionary of lists, it’ll do the same thing. So that’s what we’re going to do, we’re going to call it
'data1' here, copy all that stuff in
data1, it’s called
'data1'. And the same thing here for
of 10 lists, 10 objects from 0 through 9, with
'data1' consisting of numbers between 0 and 10 and
'data2' with numbers consisting between 11 and 10,000. It’s kind of cool, you have the frame there. So, what type of things can you do with it? Well, you can do things like this.
02:23 you added them together and all that. There’s much more possible with DataFrames, but that’s what I’m going to touch on today. Next, we’re going to move on to graphing some of this data while using Vincent.
Become a Member to join the conversation.