unibocconi.
eu
Python for Excel
Lecturer: Gianluigi Pertusi
Language
English
Course description and objectives
Nowadays, huge datasets are available to everybody and they are often too large to
fit into a spreadsheet. Although Microsoft introduced a few tools to analyse big
datasets and to automate repetitive procedures, these tools are very specific and
can be used only in the Microsoft environment. Another way to solve these
problems involves the use of Python, which is a modern and widespread
programming language. In this course Python will be used to support Excel in data
analysis, overcoming Excel’s limitations and simplifying data cleaning and
processing.
Upon successful completion of this course, students will be able to use Python to:
• Read data from Excel files
• Analyse data using Python’s libraries
• Create data report and charts through Python’s libraries
• Print the result of their analysis on Excel files
Audience
The course is aimed at:
• students willing to improve their skills in data analysis
• students who need additional tools to perform quantitative analyses on large
datasets
• students who want to exploit Python’s potential to simplify data analysis and
overcome Excel’s limitations
However, note that the course is open to a restricted audience of Bocconi students.
More specifically, only students enrolled in:
• their second or third year bachelor programs, or
unibocconi.eu
• any of the Bocconi Master programs, or
• any PhD programs
Prerequisites
Having passed the Computer Science curricular exam or having a good experience
in coding with Python is highly recommended.
Duration
12 hours
Teaching mode
This course will be taught in person. Distance mode will not be provided.
Calendar
Lecture Date Time Room
1 Wed 08/11/2023 18.15 – 19.45 N32 (Velodromo)
2 Fri 10/11/2023 14.45 – 16.15 N30 (Velodromo)
3 Fri 10/11/2023 16.30 – 18.00 N30 (Velodromo)
4 Wed 15/11/2023 18.15 – 19.45 N32 (Velodromo)
5 Fri 17/11/2023 14.45 – 16.15 N30 (Velodromo)
6 Fri 17/11/2023 16.30 – 18.00 N30 (Velodromo)
Note: lessons will be held in the traditional room and all the students have to bring their
own device.
unibocconi.eu
Syllabus of the course
Book
Lecture Topics
References
1 Introduction to custom modules
The datetime class
Ch. 3
Data analysis with pandas
Ch. 5
- DataFrames and Series
- Data manipulation
2 Data analysis with pandas
- Combining DataFrames
- Data aggregation Ch. 5
- Filtering DataFrames
Exercises
3 Importing and exporting DataFrames with pandas
Time series analysis with pandas
Ch. 5
- DatetimeIndex
Ch. 6
- Time zones
- Time series manipulations
4 Time series analysis with pandas
- More time series manipulations Ch. 5
Plotting tools Ch. 6
Exercises
5 Excel files manipulation
- pandas
Ch. 7
- openpyxl
Ch. 8
Useful tools for Excel reporting
- os module
6 Final exercise: Excel reporting
Software used
Python 3.9 (or greater)
Microsoft Excel 2019 (Office365)
unibocconi.eu
Suggested bibliography
Zumstein F., Python for Excel – A modern Environment for Automation and Data
Analysis, O’Reilly Media, 2021
Available seats
This activity is limited to 110 participants. Registrations cannot be carried out once
this number has been reached or after closing of the registration period.
Spreadsheet paths
This course can be intended as part of a wider path: