# 98735 - PYTHON CODING AND DATA SCIENCE

• Docente: Pietro Rossi
• Credits: 6
• SSD: INF/01
• Language: English
• Teaching Mode: Blended Learning
• Campus: Bologna
• Corso: Second cycle degree programme (LM) in Greening Energy Market and Finance (cod. 5885)
• from Feb 12, 2024 to May 03, 2024

## Learning outcomes

The focus of the course is on Phython coding & Data Science which have gained great popularity in the last few years, especially in the field of financial applications. Students will acquire a good knowledge of Coding with a special focus to financial application and frontier topics of green finance.

## Course contents

Basic Python

1. Using the Python Interpreter
2. An Informal Introduction to Python
3. Control Flow Tools
4. Data Structures
5. Modules
6. Input and Output
7. Errors and Exceptions
8. Classes
9. Brief Tour of the Standard Library
10. Virtual Environments and Packages

NumPy

1. Array objects
The N-dimensional array (ndarray)
Scalars
Data type objects (dtype)
Indexing routines
Iterating Over Arrays
Standard array subclasses
The array interface protocol
Datetimes and Timedeltas
1. Constants
2. Routines
Array creation routines
Array manipulation routines
Binary operations
String operations
Mathematical functions with automatic domain
Floating point error handling
Functional programming
NumPy-specific help functions
Input and output
Linear algebra (numpy.linalg)
Logic functions
Mathematical functions
Miscellaneous routines
Random sampling (numpy.random)
Set routines
Sorting, searching, and counting
Statistics

SciPy

Introduction
Special functions (scipy.special)
Integration (scipy.integrate)
Optimization (scipy.optimize)
Interpolation (scipy.interpolate)
Linear Algebra (scipy.linalg)
Statistics (scipy.stats)

pandas

1. basics
Object creation
Viewing data
Selection
Missing data
Operations
Merge
Grouping
Reshaping
Time series
Categoricals
Plotting
Getting data in/out
Gotchas
2. Intro to data structures
3. Essential basic functionality
4. IO tools (text, CSV, HDF5, …)
5. Indexing and selecting data
7. Merge, join, concatenate and compare
8. Reshaping and pivot tables
9. Working with text data
10. Working with missing data
11. Categorical data
12. Computational tools
13. Group by: split-apply-combine

Elements of matplotlib

https://docs.python.org/3/tutorial/

https://numpy.org/doc/stable/reference/index.html

https://docs.scipy.org/doc/scipy/tutorial/index.html

https://pandas.pydata.org/docs/getting_started/tutorials.html

https://matplotlib.org/stable/tutorials/introductory/index.html

## Teaching methods

Teaching will be in blended mode. Some lecture in presence some online.

Some lecture will be just the teacher talking, explaining a subject but must will be a mixture of teaching and exercises

## Assessment methods

Through the course there will be from 4 to 6 home assignment that students are expected to do and return to the tutor for grading.

Home assigned are tailored to occupy the student from 1 to 2 hours.

Final exam will be a written exam consisting in a challenging programming task.

Th final grade will be weighted equal between home assignment and the final exam.

Writing a computer program entails, among other three aspects I want to emphasize: correctness, clean programming style and performance. Correctness will absorb 60% of the value, coding style will weight 30%, the remaining 10% is taken up by performance

## Teaching tools

Most will be frontal lectures were the teacher explains concepts and discusses examples.

Python code will be showcased both as standalone scripts, developed within  an IDE but most of all examples will be presented via the Notebook.

The most important tool will be the large number of exercises that will be proposed and will challenge the student.

## Office hours

See the website of Pietro Rossi