Move from Excel to Python with Pandas Transcripts
Chapter: Aggregating, grouping, and merging
Lecture: Merging data in Excel
0:00 Up until now, we've been dealing with one Excel sheet,
0:04 but in the real world, you'll normally have multiple excel sheets or see SV files
0:09 that you need to merge together to do your analysis.
0:13 So I'm gonna go through an example of how we could add some additional data to
0:18 our sample sales file boosts Excel file We've been working with.
0:22 We have 1000 rows of data and let's say we have another file.
0:27 It has 50 rows of data that we would like to add.
0:31 So here's that other file. So what you would probably do in Excel.
0:36 This highlights your data. Copy it,
0:40 go to your other file, paste it.
0:42 And now we have our 1050 rose in that data set.
0:48 And now let's do an example of what if we wanted to modify this data set
0:53 to have, um, kind of the customer level associated with each company so that
0:59 we can do some further analysis on that.
1:02 So if we have a file that looks like this,
1:04 so we've got another. Each company has a level,
1:08 so we have 352 companies that each have a gold,
1:12 silver or platinum level Probably what you do is another copy.
1:20 And then let's paste this into a new sheet,
1:24 and then you would need to do if he look up and to figure out the
1:28 the appropriate level. So we'll call this company.
1:33 Well, this and then we'll do if you look up.
1:50 So that tells us that really Cube is a gold level company,
1:54 and then we can copy that down.
1:56 And now our data will tell us which level each company is.
2:00 Get nice data frame. With all of those rose and the company level,
2:05 we can do our further analysis.
2:07 This process is relatively straightforward in excel,
2:10 but not very repeatable. So I'm gonna show how we would do the same thing