= Programming in Python (for quantitative biologists) = == Learning objectives and expected learning outcomes == The course introduces students to imperative programming by referring to the Python language. The course is divided in two parts: 1. Python and its object-oriented features; 1. Python libraries that can be useful in scientific computation and data analysis, in particular [https://numpy.org/ NumPy] and [https://pandas.pydata.org/ pandas]. Students will acquire the ability to write and tune a program that automatizes simple computational tasks; they will be able to understand how a small piece of Python code works, to find the reasons of a malfunction and to correct it appropriately. Moreover, students will be able to use the [https://numpy.org/ NumPy] and [https://pandas.pydata.org/ pandas] library to analyze tabular data. == A.A. 2024/25 == The course will take place in the first semester. Currently, we expect to lecture on-premises, lectures will NOT be streamed. You can find some videos from last year course in the 2020/21 web page linked below. [https://orari.unimi.it/PortaleStudenti/index.php?view=easycourse&form-type=attivita&include=attivita&anno=2024&attivita=ECF5B-5_1&visualizzazione_orario=cal&periodo_didattico=&_lang=en&list=0&week_grid_type=-1&ar_codes_=&ar_select_=&col_cells=0&empty_box=0&only_grid=0&highlighted_date=0&all_events=0&faculty_group=0 Official Timetable] The course will have a total of 40 hours of lessons and 16 hours of lab practice. The exact schedule will be announced during the lessons (the first lesson is on October 1st). Since a.a. 2024/25, **attendance is mandatory for QB students.** To be admitted to the final examination a QB student must have attended ≥ 10 lectures and ≥ 6 labs. Doing a (github) homework ''within a week'', counts as ⅓ of a lecture. === Syllabus === * The Python programming language. * Native data types. * Functions, selections and iterations. * Basic data structures: lists, tuples, dictionaries. * Object-oriented encapsulation. * Iterators and generators. * Files. * Numpy multi-dimensional arrays and matrices. * Data manipulation and analysis with pandas. Any Python3 book can be used to support the learning of the general part, for example [https://minerva.unimi.it/permalink/39UMI_INST/i9q3jt/alma991017779811006031 J. Hunt "A Beginners Guide to Python 3 Programming"] (The electronic version is free for Unimi students). [https://numpy.org/ NumPy] and [https://pandas.pydata.org/ pandas] have excellent online documentation. The examination is based on laboratory exercises. A final mark (on a 30 point scale) is given, by taking into account the knowledge of the subject and tools, and the clarity of the solutions. [[PageOutline]] == Schedule == === 1. October 1, 10:30 309 === * [https://homes.di.unimi.it/monga/lucidi2425/pyqb01.pdf Slides] [https://homes.di.unimi.it/monga/lucidi2425/pyqb01-handout.pdf Handouts for printing] * [https://python.di.unimi.it/ CS Circles @ Unimi] === 2. October 3, 8:30 B6 === * [https://homes.di.unimi.it/monga/lucidi2425/pyqb02.pdf Slides] [https://homes.di.unimi.it/monga/lucidi2425/pyqb02-handout.pdf Handouts for printing] * [https://archive.org/details/1958-02_IF/page/4/mode/2up?view=theater I. Asimov, The Feeling of Power] === 3. October 8, 10:30 309 === * [https://homes.di.unimi.it/monga/lucidi2425/pyqb03.pdf Slides] [https://homes.di.unimi.it/monga/lucidi2425/pyqb03-handout.pdf Handouts for printing] === 4. October 10, 8:30 B6 === * [https://homes.di.unimi.it/monga/lucidi2425/pyqb04.pdf Slides] [https://homes.di.unimi.it/monga/lucidi2425/pyqb04-handout.pdf Handouts for printing] === 5. October 15, 10:30 309 === * [https://homes.di.unimi.it/monga/lucidi2425/pyqb05.pdf Slides] [https://homes.di.unimi.it/monga/lucidi2425/pyqb05-handout.pdf Handouts for printing] * [https://classroom.github.com/a/ToMoC4Di GitHub homework 1] === 6. October 17, 8:30 B6 === * [https://homes.di.unimi.it/monga/lucidi2425/pyqb06.pdf Slides] [https://homes.di.unimi.it/monga/lucidi2425/pyqb06-handout.pdf Handouts for printing] === 7. October 22, 10:30 309 === * [https://homes.di.unimi.it/monga/lucidi2425/pyqb07.pdf Slides] [https://homes.di.unimi.it/monga/lucidi2425/pyqb07-handout.pdf Handouts for printing] === 8. October 24, 8:30 B6 === * [https://homes.di.unimi.it/monga/lucidi2425/pyqb08.pdf Slides] [https://homes.di.unimi.it/monga/lucidi2425/pyqb08-handout.pdf Handouts for printing] * [https://classroom.github.com/a/AXkkdWes GitHub Homework "Newton sqrt"] * [https://classroom.github.com/a/8a-Ly0pu GitHub Homework "Triangle kinds"] * [https://classroom.github.com/a/7Xf8dF1X GitHub Homework "Count chars"] === 9. October 25, 8:30 Delta (LAB) === == [=#old Previous years] == * [wiki:WikiStart@231 A.A. 2023/24] * [wiki:WikiStart@181 A.A. 2022/23] * [wiki:WikiStart@132 A.A. 2021/22] * [wiki:WikiStart@79 A.A. 2020/21]