From the course: Advanced Hands-On Python: Working with Excel and Spreadsheet Data

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Challenge: Split a workbook

Challenge: Split a workbook

(bright upbeat music) - [Instructor] All right, it's time for another programming challenge. For this challenge, we're going to use XlsxWriter to perform an operation similar to one we did earlier in the course. So, your program is going to take the Inventory.csv file, which you can see here, and we'll transform it into an Excel workbook. The workbook will have separate worksheets for each of the categories of the items in the file. So in other words, there'll be worksheets for fruits and vegetables and meats and so on. And all the items associated with that category will be in that worksheet. Each worksheet will also have a copy of the column headers. So, I'm going to run my finished code so you can see what the output should look like. So here in my finished file, I'm going to run my finished solution and we can see that Inventory.xlsx has been created. So, let's open that up. All right, and sure enough, we can see that when I open it, there are worksheets for each category, right?…

Contents