Magicians out there....
I need your help with the best approaches for the below use case.
I have an excel sheet whith lakhs of rows of data and I need to filter it based on some criteria and need to create new multiple tiles. I am in no mood to do it manually hence started working out on a python script that will do the job for me. however, I am facing a few challenges in achieving the end goal. The challenges are the "Color Formatting" and "comment" added to the cell.
Let's recreate the scenario. I have attached a sample excel sheet for your reference here. it includes "Indian Cars" data with 4 headers called (Brand, Model, Fuel Type & Transmission Type). I need to filter the data based on "Brand" and create a new excel file (workbook) with the Brand name as the excel file name.
Approach 1:- First I started with loading an excelsheet into a data frame with Pandas and then filtered the data and exported it, that was quite fast and easy and I loved it. However, I am losing cell colors and added note to the cell (Model & Fuel type)
Note: I tried styling the pandas, however, for some reason, it's not working for me.
Approach 2:- I though of using Openpyxl & Xlsxwriter, however, the issue is I am unable to filter data and keep comments added to the header.
Approach 3:- Logically, I can create a copy of my existing sheet and delete the unwanted rows from it and save it with desired name, that should do the job for me. Unfortunately, I am unable to figure out how to achieve it in python.
Kindly share your thoughts on this and help me with right approach... and If I can get a sample code or full code... that would just make my day... :D