Laboratory Introduction to Coding and Data Management for Economics and Political Science
A.Y. 2024/2025
Learning objectives
To introduce scripting programming, and the key objects of the programming language Python;
To present the main libraries Python dedicated to data management analysis and visualisation, for applications in economics and finance
To present the main libraries Python dedicated to data management analysis and visualisation, for applications in economics and finance
Expected learning outcomes
-At the end of the module the student will be able to:
-implement scripts in Python, understanding the meaning and theeffects of the instructions in the code
-manage techniques for data manipulation, analysis and visualisationin relation to applications to economics and finance
-implement scripts in Python for data manipulation, analysis andvisualisation
-implement scripts in Python, understanding the meaning and theeffects of the instructions in the code
-manage techniques for data manipulation, analysis and visualisationin relation to applications to economics and finance
-implement scripts in Python for data manipulation, analysis andvisualisation
Lesson period: Second trimester
Assessment methods: Giudizio di approvazione
Assessment result: superato/non superato
Single course
This course cannot be attended as a single course. Please check our list of single courses to find the ones available for enrolment.
Course syllabus and organization
Single session
Responsible
Lesson period
Second trimester
Course syllabus
The lectures will be focused on the following topics:
1. Outline of the Python language. Comparison to several other compiled or interpreted programming languages. Showcase of the Python abilities.
2. Usage of Python in the cloud. Get a local Python environment up and running. Execution of Python commands. Running Python programs. Installing code libraries.
3. Functions: basics of functions, defining functions, applications of functions, recursive function calls.
4. Python essentials: data types, input and output, iterating, comparisons and logical operators, coding style, and documentation.
5. Object-oriented programming: classes, objects, methods, names and name resolution.
6. Python for scientific computing: introduction of the most used scientific libraries, code speed optimisation, vectorisation.
7. The NumPy library: arrays, arithmetic operations, matrix multiplications, broadcasting, mutability, and copying arrays.
8. The Matplotlib library: the MATLAB-style API, the object-oriented API, 2D and 3D plots, subplots, and style sheets.
9. The SciPy library: SciPy vs NumPy, statistics, roots and fixed points, optimisation, integration, and linear algebra.
10. The Pandas library: Pandas series, Pandas DataFrames, and on-line data sources.
1. Outline of the Python language. Comparison to several other compiled or interpreted programming languages. Showcase of the Python abilities.
2. Usage of Python in the cloud. Get a local Python environment up and running. Execution of Python commands. Running Python programs. Installing code libraries.
3. Functions: basics of functions, defining functions, applications of functions, recursive function calls.
4. Python essentials: data types, input and output, iterating, comparisons and logical operators, coding style, and documentation.
5. Object-oriented programming: classes, objects, methods, names and name resolution.
6. Python for scientific computing: introduction of the most used scientific libraries, code speed optimisation, vectorisation.
7. The NumPy library: arrays, arithmetic operations, matrix multiplications, broadcasting, mutability, and copying arrays.
8. The Matplotlib library: the MATLAB-style API, the object-oriented API, 2D and 3D plots, subplots, and style sheets.
9. The SciPy library: SciPy vs NumPy, statistics, roots and fixed points, optimisation, integration, and linear algebra.
10. The Pandas library: Pandas series, Pandas DataFrames, and on-line data sources.
Prerequisites for admission
No previous knowledge is required, however it is preferable to have knowledge of at least another interpreted programming language, for instance: R, MATLAB, Mathematica, JavaScript or PHP.
Teaching methods
Lectures are planned with the help of Jupyter notebooks and teaching materials that will be made available step by step on Microsoft Teams.
Teaching Resources
Jupyter notebooks and teaching materials provided by the Professor will be made available step by step on Microsoft Teams. In particular, the teaching material will refer to the following bibliography:
1. T. J. Sargent, J. Stachurski, "Python Programming for Economics and Finance". December 2022 edition;
2. T. J. Sargent, J. Stachurski, "Quantitative Economics with Python". December 2022 edition;
3. Y. Hilpisch, "Python for finance". O'Reilly. 2nd edition. 2018;
4. M. Lutz, "Learning Python". O'Reilly. 5th edition. 2015.
1. T. J. Sargent, J. Stachurski, "Python Programming for Economics and Finance". December 2022 edition;
2. T. J. Sargent, J. Stachurski, "Quantitative Economics with Python". December 2022 edition;
3. Y. Hilpisch, "Python for finance". O'Reilly. 2nd edition. 2018;
4. M. Lutz, "Learning Python". O'Reilly. 5th edition. 2015.
Assessment methods and Criteria
The exam offers two options for students to choose from:
1. Final project: Students can agree in advance with the Professor on the content of the project, which may focus on the analysis, manipulation, and visualization of economic, financial, or social data using Python. The final project aims to verify that students have understood the tools introduced during the laboratory sessions and are able to use them correctly, thoughtfully, and critically.
2. Weekly exercises: Students can choose to complete weekly exercises assigned by the instructor throughout the course. These exercises must be submitted at the end of the course and will be evaluated for the final credit registration.
1. Final project: Students can agree in advance with the Professor on the content of the project, which may focus on the analysis, manipulation, and visualization of economic, financial, or social data using Python. The final project aims to verify that students have understood the tools introduced during the laboratory sessions and are able to use them correctly, thoughtfully, and critically.
2. Weekly exercises: Students can choose to complete weekly exercises assigned by the instructor throughout the course. These exercises must be submitted at the end of the course and will be evaluated for the final credit registration.
Professor(s)
Reception:
To be agreed by scheduling an appointment
Room 37 (3rd floor) or Microsoft Teams