= 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. 2023/24 == 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://easystaff.divsi.unimi.it/PortaleStudenti/index.php?view=easycourse&form-type=attivita&include=attivita&anno=2023&attivita%5B%5D=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 (Tuesdays and Thursdays) and 16 hours of lab practice (Fridays). The exact schedule will be announced during the lessons (the first lesson is on October 3). === 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://link-springer-com.pros.lib.unimi.it/book/10.1007%2F978-3-030-20290-3 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]] == 2023/24 == * [https://homes.di.unimi.it/monga/lucidi2324/pyqb00.pdf All slides in one file] [https://homes.di.unimi.it/monga/lucidi2324/pyqb00-handout.pdf Handouts for printing] === Exams === * [https://docs.google.com/spreadsheets/d/e/2PACX-1vRz5_kjw26dJBcHIKgvFmPDohrhore8V4Ox0olc4mkYOwUlQlKfqMoKW4k95Q7wUg3AOBf_ExBO7s6d/pubhtml?gid=119669032&single=true February 20 results] [https://github.com/pyqb2023/pyqb-20240220 Exam text] * [https://docs.google.com/spreadsheets/d/e/2PACX-1vQw9-61i4JuWXGnuv4A0C2NC5qVgvhQbWQSjEaSac46Vb_q92jH2h1aJWDgR06eMByq0lgKMNmJFPHH/pubhtml?gid=119669032&single=true February 6 results] [https://github.com/pyqb2023/pyqb-20240206 Exam text] * [https://docs.google.com/spreadsheets/d/e/2PACX-1vTX24Z_E5y47qggDbjHE1Rkg6Vco1xa_o8LD-7CZpGC6guOt2NFUQ8rW1XUxINGtTy8z61eR7PKPCcQ/pubhtml?gid=119669032&single=true January 23 results] [https://github.com/pyqb2023/pyqb-20240123 Exam text] === 1. October 3, 10:30 Room Jommi === * [https://homes.di.unimi.it/monga/lucidi2324/pyqb01.pdf Slides] [https://homes.di.unimi.it/monga/lucidi2324/pyqb01-handout.pdf Handouts for printing] * [https://python.di.unimi.it/ CS Circles @ Unimi] === 2. October 5, 8:30 Room 109 === * [https://homes.di.unimi.it/monga/lucidi2324/pyqb02.pdf Slides] [https://homes.di.unimi.it/monga/lucidi2324/pyqb02-handout.pdf Handouts for printing] === 3. October 10, 10:30 Room Jommi === * [https://homes.di.unimi.it/monga/lucidi2324/pyqb03.pdf Slides] [https://homes.di.unimi.it/monga/lucidi2324/pyqb03-handout.pdf Handouts for printing] === 4. October 12, 8:30 Room 109 === * [https://homes.di.unimi.it/monga/lucidi2324/pyqb04.pdf Slides] [https://homes.di.unimi.it/monga/lucidi2324/pyqb04-handout.pdf Handouts for printing] === 5. October 17, 10:30 Room Jommi === * [https://homes.di.unimi.it/monga/lucidi2324/pyqb05.pdf Slides] [https://homes.di.unimi.it/monga/lucidi2324/pyqb05-handout.pdf Handouts for printing] === ~~October 19, 8:30 Room 109~~ === === 6. October 24, 10:30 Room Jommi === * [https://homes.di.unimi.it/monga/lucidi2324/pyqb06.pdf Slides] [https://homes.di.unimi.it/monga/lucidi2324/pyqb06-handout.pdf Handouts for printing] === 7. October 26, 8:30 Room 109 === * [https://homes.di.unimi.it/monga/lucidi2324/pyqb07.pdf Slides] [https://homes.di.unimi.it/monga/lucidi2324/pyqb07-handout.pdf Handouts for printing] === 8. October 27, 8:30 Lab Lambda === * [https://classroom.github.com/a/eXu9GUsu Count chars exercise] === 9. October 31, 10:30 Room Jommi === * [https://classroom.github.com/a/ATd2acrA Newton square root] * [https://classroom.github.com/a/JM30gLtV DNA hamming] * [https://classroom.github.com/a/38aw1ZgW Rainfall] === 10. November 2, 8:30 Room 109 === * [https://homes.di.unimi.it/monga/lucidi2324/pyqb08.pdf Slides] [https://homes.di.unimi.it/monga/lucidi2324/pyqb08-handout.pdf Handouts for printing] === 11. November 3, 8:30 Lab Lambda === * [https://classroom.github.com/a/lRCUNL9t Pythagorean triplets] * [https://classroom.github.com/a/wY3AybRS Flatten lists] * [https://classroom.github.com/a/e4-l2dA4 DNA fasta files] === 12. November 7, 10:30 Room Jommi === * [https://homes.di.unimi.it/monga/lucidi2324/pyqb09.pdf Slides] [https://homes.di.unimi.it/monga/lucidi2324/pyqb09-handout.pdf Handouts for printing] === 13. November 9, 8:30 Room 109 === * [https://homes.di.unimi.it/monga/lucidi2324/pyqb10.pdf Slides] [https://homes.di.unimi.it/monga/lucidi2324/pyqb10-handout.pdf Handouts for printing] === 14. November 10, 8:30 Lab Lambda === * [https://classroom.github.com/a/nvjaBW2o Pseudo random generator] * [https://classroom.github.com/a/DDbvSfTX Triangle kinds] * [https://classroom.github.com/a/Jtna3XXc Sonar] * [https://classroom.github.com/a/qVXKCC85 Eels] === 15. November 21, 10:30 Room Jommi === * [https://homes.di.unimi.it/monga/lucidi2324/pyqb11.pdf Slides] [https://homes.di.unimi.it/monga/lucidi2324/pyqb11-handout.pdf Handouts for printing] === 16. November 23, 8:30 Room 109 === * [https://homes.di.unimi.it/monga/lucidi2324/pyqb12.pdf Slides] [https://homes.di.unimi.it/monga/lucidi2324/pyqb12-handout.pdf Handouts for printing] === 17. November 24, 8:30 Lab Lambda === * [https://classroom.github.com/a/7VtZeATq NumPy basics] === 18. November 28, 10:30 Room Jommi === * [https://homes.di.unimi.it/monga/lucidi2324/pyqb13.pdf Slides] [https://homes.di.unimi.it/monga/lucidi2324/pyqb13-handout.pdf Handouts for printing] === 19. November 30, 8:30 Room 109 === * [https://homes.di.unimi.it/monga/lucidi2324/pyqb14.pdf Slides] [https://homes.di.unimi.it/monga/lucidi2324/pyqb14-handout.pdf Handouts for printing] === 20. December 1, 8:30 Lab Lambda === * [https://classroom.github.com/a/556BUTRi NumPy 2] === 21. December 5, 10:30 Room Jommi === * [https://homes.di.unimi.it/monga/lucidi2324/pyqb15.pdf Slides] [https://homes.di.unimi.it/monga/lucidi2324/pyqb15-handout.pdf Handouts for printing] * [https://classroom.github.com/a/udrzg2Fy Life] === 22. December 12, 10:30 Room Jommi === * [https://homes.di.unimi.it/monga/lucidi2324/pyqb16.pdf Slides] [https://homes.di.unimi.it/monga/lucidi2324/pyqb16-handout.pdf Handouts for printing] * [https://classroom.github.com/a/FOfcYU29 Gray-Scott] === 23. December 14, 8:30 Room 109 === * [https://homes.di.unimi.it/monga/lucidi2324/pyqb17.pdf Slides] [https://homes.di.unimi.it/monga/lucidi2324/pyqb17-handout.pdf Handouts for printing] === 24. December 15, 8:30 Lab Lambda === * [https://classroom.github.com/a/2zKqwgHm NumPy images] === 25. December 19, 10:30 Room Jommi === * [https://homes.di.unimi.it/monga/lucidi2324/pyqb18.pdf Slides] [https://homes.di.unimi.it/monga/lucidi2324/pyqb18-handout.pdf Handouts for printing] === 26. December 21, 8:30 Room 109 === * [https://homes.di.unimi.it/monga/lucidi2324/pyqb19.pdf Slides] [https://homes.di.unimi.it/monga/lucidi2324/pyqb19-handout.pdf Handouts for printing] * [https://classroom.github.com/a/CyJmxkgm PyMC Howell's data example] The exercises are already solved, but use them to tinker with pandas and pymc. === 27. January 9, 10:30 Lab 306 === * [https://classroom.github.com/a/tvfV68IA Pandas/Pymc on Howell's data] === 28. January 12, 8:30 Lab Lambda === * [https://github.com/pyqb2022/pyqb-20230906 Exam simulation] == [=#old Previous years] == * [wiki:WikiStart@181 A.A. 2022/23] * [wiki:WikiStart@132 A.A. 2021/22] * [wiki:WikiStart@79 A.A. 2020/21]