Programming for Data Science

Base Knowledge

CB1. No prior programming knowledge is required.
CB2. Ability to use a computer autonomously, including managing files and folders, installing and running applications, and using a Web browser.
CB3. Elementary knowledge of algebraic calculation, graphical representation of functions and descriptive statistics, including mean, median, variance and standard deviation.
CB4. English reading skills sufficient to understand technical documentation, error messages and learning resources related to Python and Data Science.

Teaching Methodologies

ME1. Interactive instruction: Brief and structured presentation of fundamental concepts, accompanied by code demonstrations, guiding questions and short exercises, contributing primarily to OA1 and OA2.

ME2. Problem-based practical learning: Individual and collaborative resolution of progressively challenging programming and data analysis problems in an interactive computing environment. This methodology develops OA2 to OA5 and competences CD1 and CD2.

ME3. Project-based learning: Development, in small groups, of an integrated Data Science project using real or open data and involving data acquisition, preparation, visualisation, modelling and interpretation. This methodology addresses OA3 to OA6 and promotes CD1 to CD4.

ME4. Collaborative programming and peer review: Programming activities carried out in pairs or small groups, discussion of alternative solutions and critical code review, reinforcing OA2 to OA6 and the competences associated with problem-solving and technical communication.

ME5. Tutorial guidance and formative feedback: Regular monitoring of exercises and the different project stages, including clarification of doubts, debugging support and feedback aimed at continuous improvement, promoting autonomy and the consolidation of all learning outcomes.

ME6. Guided autonomous study: Use of exercises, notebooks, technical documentation and other digital resources to deepen and consolidate learning, in alignment with the autonomous workload associated with the course unit’s ECTS credits.

Learning Results

Upon completion of this curricular unit, the student will be able to:
OA1. Understand the basic principles of algorithms and programming.
OA2. Develop, test and debug Python programs using data types, control structures, functions and data structures.
OA3. Import, prepare, transform and analyze data using NumPy and Pandas.
OA4. Produce and interpret data visualizations using Matplotlib.
OA5. Apply introductory regression, classification and clustering methods using scikit-learn and evaluate the results.
OA6. Develop small Data Science projects involving files, APIs, text and task automation.

Associated competences:
CD1. Structured problem-solving and computational thinking.
CD2. Autonomy in using programming tools for data analysis.
CD3. Communication and reasoned defense of technical choices.
CD4. Critical, ethical and responsible use of digital and AI tools.

Program

P1. Python fundamentals
1.1. Algorithms, syntax, execution, data types and operators.

P2. Data structures
2.1. Lists, tuples, dictionaries and sets.

P3. Control structures and modularisation
3.1. Conditions, loops, functions, basic error handling and debugging.

P4. Data acquisition and preparation
4.1. Reading and writing files, NumPy and Pandas.
4.2. Data cleaning, transformation and initial exploration.

P5. Data visualisation
5.1. Creating and interpreting plots with Matplotlib.

P6. Introduction to machine learning
6.1. Workflow with scikit-learn.
6.2. Regression, classification, clustering and model evaluation.

P7. Programming applications in Data Science
7.1. Basic text processing.
7.2. Task automation and data access through APIs.
7.3. Integrated development of a small Data Science project.

Curricular Unit Teachers

Ricardo Manuel da Silva Malheiro

Grading Methods

A) Periodic assessment

MA1. Practical Data Science project (50%): A project developed within the scope of the course unit, individually or in a group, involving the resolution of a Data Science problem using Python. The project must include an individual oral presentation and defense, during which each student must demonstrate knowledge of the developed code, the technical decisions made, and the results obtained. Grade between 0 and 20. Minimum grade of 9.5 out of 20.

MA2. Individual written test (50%): A test designed to assess the programming knowledge, competences and problem-solving skills developed throughout the course unit. Grade between 0 and 20. Minimum grade of 8.5 out of 20.

Final grade formula:
FG = 0.50 × MA1 + 0.50 × MA2

Passing the course unit requires compliance with the minimum grades for MA1 and MA2 and a final grade of at least 10 out of 20.

Use of Artificial Intelligence: Generative AI tools may be used in MA1 to support research, clarification of concepts, debugging, code suggestion or explanation, and documentation improvement. The project must include an AI-use declaration identifying the tools used, their purposes, and the most relevant prompts. Students are responsible for validating all generated content and must be able to explain and fully defend the submitted solution. AI tools are not permitted during MA2 or the oral defense.

B) Final assessment - examination periods

MA3. Individual written examination (100%): An examination covering all the contents and learning outcomes of the course unit. Grade between 0 and 20. Passing requires a minimum grade of 10 out of 20.

The written examination may include questions involving code interpretation, development and correction, analysis of results, and the resolution of programming and Data Science problems. The use of AI tools is not permitted.

Attendance: Class attendance is not an assessment component. Attendance at the written test and at the oral presentation and defense of the project is mandatory.

Working students: Students with working-student status are exempt from class attendance requirements and may complete MA1 individually, subject to prior agreement with the lecturer. The individual oral presentation and defense remain mandatory.

Grade improvement: Grade improvement is carried out through an individual written examination during the examination period established for this purpose, covering all course unit contents. The new grade replaces the previous grade only when it is higher, in accordance with the applicable regulations.


    Internship(s)

    NAO

    Bibliography

    Main bibliography

    1. Deitel, P., & Deitel, H. (2022). Intro to Python for computer science and data science: Learning to program with AI, big data and the cloud (1st ed.). Pearson.
    2. McKinney, W. (2022). Python for data analysis: Data wrangling with pandas, NumPy, and Jupyter (3rd ed.). O’Reilly Media.
    3. VanderPlas, J. (2022). Python data science handbook: Essential tools for working with data (2nd ed.). O’Reilly Media.

    Complementary bibliography

    1. Grus, J. (2019). Data science from scratch: First principles with Python (2nd ed.). O’Reilly Media.
    2. Python Software Foundation. (n.d.). Python 3 documentation. [Available online through the official Python.org portal].