From the course: Data Analysis with Python and Pandas

Unlock this course with a free trial

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

Solution: Subplots

Solution: Subplots

- [Instructor] Alright, everybody. Our solution code is up on the right. Let's go ahead and dive into the notebook. Alright, the first thing that we needed to do was read in our transactions table. Hopefully, you were able to find this path somewhere else in the notebook. But just remember, these two dots will push us one folder outside of our current file path. This will then push us into the retail folder, and then we'll access our "transactions.csv". And so, there were a couple ways we could do this. So I first created a transactions DataFrame and then we're going to create a "stores_1234" DataFrame. And we're going to use our lock accessor to filter to "stores_1234" using our ".isin" operator. We then create a ".pivot_table" with our "index="date"" and our columns of "store_nbr". And then we're dropping our second column level axis. We could also chain this here. So as opposed to creating a separate DataFrame for transactions, we could also consider something like this. So we're…

Contents