98735 - PYTHON CODING AND DATA SCIENCE

Academic Year 2022/2023

  • Docente: Pietro Rossi
  • Credits: 6
  • SSD: INF/01
  • Language: English
  • Teaching Mode: Traditional lectures
  • Campus: Bologna
  • Corso: Second cycle degree programme (LM) in Greening Energy Market and Finance (cod. 5885)

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
    Masked arrays
    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
    Masked array operations
    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
  6. MultiIndex / advanced indexing
  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

Readings/Bibliography

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 6 to 10 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