From the course: Data Analysis with Python and Pandas

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Solution: Bringing it all together

Solution: Bringing it all together

- [Instructor] All right, everybody. Our solution code is up on the right. This was definitely more involved than any of the other assignments. So if you got tripped up, hopefully you were able to take a peek at the solution code and get back on the track. But let's go ahead and walk through this step by step. We had our data read in for us. We have our family array and our sales array. The first step was to filter sales array to include only transactions where family array was equal to produce. So we need to specify sales array. Then we want to filter it to family array equals produce. It's all caps in the data. And then let's... All right, so we have, it looks like, about 30 sales. Let's just take a quick look at the size of this array. And it is indeed 30. So if you got 30 here, that means we're working with the exact same data. So let's go ahead and call this produce array. And we'll store that array here. The next piece was sampling this down to be roughly half of the current…

Contents