Programming for Social Data Science
A.Y. 2026/2027
Learning objectives
This course supports the mission of CSPS to equip students with the technical and practical
competences needed to access, manage, and analyze real-world data, enabling them to apply
computational methods and data-driven insights using Python and R.
competences needed to access, manage, and analyze real-world data, enabling them to apply
computational methods and data-driven insights using Python and R.
Expected learning outcomes
By the end of this course, students will be able to independently acquire, manage, and
analyze data using both Python and R. They will develop practical proficiency in working
within interactive environments such as Jupyter and RStudio, enabling them to apply
fundamental programming concepts across different platforms. Learners will be equipped to
handle a variety of data formats, perform essential cleaning and transformation tasks, and
implement strategies for integrating and organizing heterogeneous datasets. These skills will
prepare them to engage confidently with data-driven problems in real-world contexts.
In addition, students will gain experience in accessing and utilizing publicly available data
repositories, applying appropriate preprocessing techniques to prepare datasets for analysis.
They will learn to address common data challenges, such as missing values and
inconsistencies, and to create effective visual representations to better understand their data.
Finally, students will be introduced to basic machine learning methods, including both
supervised and unsupervised approaches, and will acquire the ability to critically evaluate
model performance using standard metrics. Collectively, these objectives ensure that students
not only build technical competence but also develop the analytical mindset needed to
translate raw data into meaningful insights.
analyze data using both Python and R. They will develop practical proficiency in working
within interactive environments such as Jupyter and RStudio, enabling them to apply
fundamental programming concepts across different platforms. Learners will be equipped to
handle a variety of data formats, perform essential cleaning and transformation tasks, and
implement strategies for integrating and organizing heterogeneous datasets. These skills will
prepare them to engage confidently with data-driven problems in real-world contexts.
In addition, students will gain experience in accessing and utilizing publicly available data
repositories, applying appropriate preprocessing techniques to prepare datasets for analysis.
They will learn to address common data challenges, such as missing values and
inconsistencies, and to create effective visual representations to better understand their data.
Finally, students will be introduced to basic machine learning methods, including both
supervised and unsupervised approaches, and will acquire the ability to critically evaluate
model performance using standard metrics. Collectively, these objectives ensure that students
not only build technical competence but also develop the analytical mindset needed to
translate raw data into meaningful insights.
Lesson period: First trimester
Assessment methods: Esame
Assessment result: voto verbalizzato in trentesimi
Single course
This course can be attended as a single course.
Course syllabus and organization
Single session
Responsible
Lesson period
First trimester
Course syllabus
The course introduces programming for data analysis using the two languages most widely used in data science, Python and R, working in interactive environments (Jupyter and RStudio). It is organised around the typical data-science workflow and covers the following topics:
1. Introduction to programming for social data science; working environments (Jupyter and RStudio).
2. Fundamental programming concepts: data types, variables, data structures, control flow, iteration and functions.
3. Data import and file types (e.g. CSV, JSON, spreadsheets); reading and writing data.
4. Accessing data from publicly available repositories and APIs.
5. Data wrangling: cleaning, transforming, filtering, merging and organising heterogeneous datasets; handling missing values and inconsistencies.
6. Descriptive statistics, data visualisation, and introduction to regression analysis.
7. Introduction to machine learning: supervised and unsupervised methods, and the evaluation of model performance using standard metrics.
Theoretical lessons are interleaved with live coding and hands-on exercises on real datasets throughout the course.
1. Introduction to programming for social data science; working environments (Jupyter and RStudio).
2. Fundamental programming concepts: data types, variables, data structures, control flow, iteration and functions.
3. Data import and file types (e.g. CSV, JSON, spreadsheets); reading and writing data.
4. Accessing data from publicly available repositories and APIs.
5. Data wrangling: cleaning, transforming, filtering, merging and organising heterogeneous datasets; handling missing values and inconsistencies.
6. Descriptive statistics, data visualisation, and introduction to regression analysis.
7. Introduction to machine learning: supervised and unsupervised methods, and the evaluation of model performance using standard metrics.
Theoretical lessons are interleaved with live coding and hands-on exercises on real datasets throughout the course.
Prerequisites for admission
No formal prerequisites are required to attend the course. It is designed for students with little or no previous programming experience: all concepts are introduced from the ground up. A basic familiarity with computers (installing software, managing files) is assumed. Students from other degree programmes interested in taking the exam are welcome, under the same conditions.
Teaching methods
The course combines frontal lessons with live coding and hands-on programming exercises, carried out in interactive environments (Jupyter for Python and RStudio for R). Each concept introduced in the lessons is immediately put into practice on real datasets through guided exercises, so that conceptual understanding and practical coding skill are developed together. Slides, code notebooks and datasets are made available through the course Ariel/MyAriel page. Given the hands-on nature of the activities, attendance is strongly recommended.
Teaching Resources
- Hadley Wickham, Mine Çetinkaya-Rundel, Garrett Grolemund, R for Data Science, 2nd ed., O'Reilly, 2023 (freely available at r4ds.hadley.nz).
- Mark Lutz, Learning Python: Powerful Object-Oriented Programming, 6th ed., O'Reilly, 2025.
- Bernie Hogan, From Social Science to Data Science: Key Data Collection and Analysis Skills in Python, Sage, 2022.
Additional materials (slides, notebooks and datasets) are provided through the course Ariel/MyAriel page.
- Mark Lutz, Learning Python: Powerful Object-Oriented Programming, 6th ed., O'Reilly, 2025.
- Bernie Hogan, From Social Science to Data Science: Key Data Collection and Analysis Skills in Python, Sage, 2022.
Additional materials (slides, notebooks and datasets) are provided through the course Ariel/MyAriel page.
Assessment methods and Criteria
The achievement of the expected learning outcomes is assessed through a written exam, a personal project work, and can be integrated by an oral exam.
The written exam lasts 90 minutes and combines closed-set questions (multiple-choice or short-answer items) and open-set questions (requiring brief explanations, justifications or the interpretation of results). The questions cover both theoretical concepts and short practical coding tasks (i.e., reading, interpreting or writing short code snippets) and may refer to either Python or R. The written exam tests the full range of topics covered during the course, including the introductory machine-learning methods. It assesses the student's understanding of the course concepts and their ability to read and write basic code.
The personal project work is expected to be submitted at least one week before the final written exam, and demonstrates the ability of the student to perform independent applied programming work, including a complete data-analysis task in which the student applies the workflow seen in class (data import, wrangling, visualisation and analysis). The student will be instructed in class regarding the LLM-related policy. The written exam can contain questions about the personal project work.
The oral exam may be held after the written test and can rely both on the general contents covered in class, and on the programming project carried out by the student.
The final mark, expressed in thirtieths, takes into account all components, evaluating both practical coding ability and the understanding of the underlying concepts. Detailed instructions for the exam and the project are provided in class.
The written exam lasts 90 minutes and combines closed-set questions (multiple-choice or short-answer items) and open-set questions (requiring brief explanations, justifications or the interpretation of results). The questions cover both theoretical concepts and short practical coding tasks (i.e., reading, interpreting or writing short code snippets) and may refer to either Python or R. The written exam tests the full range of topics covered during the course, including the introductory machine-learning methods. It assesses the student's understanding of the course concepts and their ability to read and write basic code.
The personal project work is expected to be submitted at least one week before the final written exam, and demonstrates the ability of the student to perform independent applied programming work, including a complete data-analysis task in which the student applies the workflow seen in class (data import, wrangling, visualisation and analysis). The student will be instructed in class regarding the LLM-related policy. The written exam can contain questions about the personal project work.
The oral exam may be held after the written test and can rely both on the general contents covered in class, and on the programming project carried out by the student.
The final mark, expressed in thirtieths, takes into account all components, evaluating both practical coding ability and the understanding of the underlying concepts. Detailed instructions for the exam and the project are provided in class.
GSPS-02/A - Political Science - University credits: 3
INFO-01/A - Informatics - University credits: 3
INFO-01/A - Informatics - University credits: 3
Lessons: 40 hours
Professors:
De Angelis Andrea, Dimitri Giovanna Maria
Professor(s)
Reception:
To be Fixed Upon Appointment