Working with cell formats in Excel
Presenting information in spreadsheets is not just a matter of organizing it into cells or displaying it graphically in charts. It also involves changing the format to highlight the important details. In this recipe, we'll see how to manipulate the format of cells to enhance the results and present the data in the best way.
Getting ready
We will use the openpyxl
module. We should install the module, adding it to our requirements.txt
file as follows:
$ echo "openpyxl==3.0.3" >> requirements.txt
$ pip install -r requirements.txt
We'll store it in the new file information about the movies with the most attendance. The data is extracted from here: http://www.mrob.com/pub/film-video/topadj.html.
How to do it...
- Import the
openpyxl
module and create a new Excel file:>>> import openpyxl >>> from openpyxl.styles import Font, PatternFill, Border, Side >>> xlsfile...