= 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. 2020/21 The course will take place in the second semester. If pandemic restrictions persist, lectures will be mainly streamed (with synchronous interaction with the instructors via MS Teams); streamed videos will be available until the conclusion of the course. Some lesson could be registered in asynchronous form. Laboratory exercises will conducted autonomously by the students and special synchronous feedback sessions will be organized. [https://easystaff.divsi.unimi.it/PortaleStudenti/index.php?view=easycourse&form-type=attivita&include=attivita&anno=2020&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] As long as local regulations permit it, the lab part of the course will be held "on site": recordings will be available, but, please attend if you can, since lab coaching is much more effective with face-to-face interactions. The currently planned schedule (date format is day/month) is: ||= Lessons (40h) =|| Mo 1/3, Fr 5/3, Mo 8/3|| //Fr 12/3// ||Mo 15/3 //Fr 19/3// ||Mo 22/3, Fr 26/3, Mo 29/3 //Fr 9/4// ||Mo 12/4, Fr 16/4, Mo 19/4||Mo 26/4, ~~Fr 30/4~~, Mo 3/5||Mo 10/5, ~~Fr 14/5~~, Mo 17/5||Mo 24/5, ~~Fr 28/5~~, Mo 31/5|| Mo 7/6 || ||= Labs, Room DELTA (16h) =|| || ~~Fr 12/3~~ || ~~Fr 19/3~~|| ~~Fr 9/4~~|| Fr 23/4|| Fr 30/4, Fr 7/5|| Fr 14/5, Fr 21/5|| Fr 28/5, Fr 4/6|| Fr 11/6 || ||= Setup =|| Scaffolded |||||||| Plain Python interpreter |||||||| Notebooks || Please answer to [https://homes.di.unimi.it/monga/lucidi2021/survey-pyqb.html this survey]. During these hard times of physical distance it is important to keep a social proximity: subscribe to the forum on [https://pyqb.zulipchat.com/join/eitgxwoku67aw55zwunua3hj/ Zulip] (use an `@studenti.unimi.it` email). === Exams * [https://docs.google.com/spreadsheets/d/e/2PACX-1vSCCWqybVJdcFkIWvApDaQeL-h1kWskv07r7PXXbAt5Iesk4YSJQarZttipmbmEmCAPeQk_fWA83X-u/pubhtml?gid=119669032&single=true February 8 Results] [https://github.com/monga-didattica/pyqb-20220208 Exam text] * [https://docs.google.com/spreadsheets/d/e/2PACX-1vQKmzgzdjgK05cCEgu7MPA-UQI2FhWCS8XvMyaRmSg76-7qpEeQhYA-qPmAOXL6F4b2qbEDZOTFt9s1/pubhtml?gid=119669032&single=true January 17 Results] [https://github.com/monga-didattica/pyqb-20220117 Exam text] * [https://docs.google.com/spreadsheets/d/e/2PACX-1vQUi1AaGFqxC3xv5UPJX00c9Abf7kIfvZfAqVBBOtgFY5XzUBKwhNbCH6L28ONgFKU30oxaQ3Kzc0zC/pubhtml?gid=119669032&single=true September 20 Results] [https://github.com/monga-didattica/pyqb-20210920 Exam text] * [https://docs.google.com/spreadsheets/d/e/2PACX-1vS3dJdsCzSq2i5HuON6XLORrSkkpSCJ8F3eils3_yWpCXiaVtDOUxJmXri8R5-0lTGRAO2fyoK0uhHV/pubhtml?gid=119669032&single=true September 8 Results] [https://github.com/monga-didattica/pyqb-20210908 Exam text] * [https://docs.google.com/spreadsheets/d/e/2PACX-1vRvVFvyIsCUn4twlQEpx5kBCBDgJT6GeWpidahNXvD2bDWcItYs2b46hf0a34Gf3YreMJ3WiI8G4a4H/pubhtml?gid=119669032&single=true July 19 Results] [https://github.com/monga-didattica/pyqb-20210719 Exam text] * [https://docs.google.com/spreadsheets/d/e/2PACX-1vRhQvIKmNDaGY22c93jpPrBZagOIAHgz5D_BvRFimBXiJSE7W8jk4cYuYHzjWkn7OT-hC7etkUBWLrG/pubhtml?gid=119669032&single=true July 5 Results] [https://github.com/monga-didattica/pyqb-20210705 Exam text] * [https://docs.google.com/spreadsheets/d/e/2PACX-1vT7qdyIlXMSwOWo6YMTTPGXSjDjTggbVkZZ8J7PsGYXRaMzxnrx3FvM-8dfSy9djHxLu3Vg5zcgDPrD/pubhtml?gid=119669032&single=true June 21 Results] [https://github.com/monga-didattica/pyqb-20210621 Exam text] === 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: in accordance with the current Rector decree, the [https://www.unimi.it/en/study/bachelor-and-master-study/following-your-programme-study/sitting-exams examinations] for June and July 2021 will be **in-person**. 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]] [https://homes.di.unimi.it/monga/lucidi2021/pyqb00.pdf All the slides] -- [https://homes.di.unimi.it/monga/lucidi2021/pyqb00-handout.pdf All the slides (printing version)] === 1. March 1, 2021, 9:30-11:30 am * [https://homes.di.unimi.it/monga/lucidi2021/pyqb01.pdf Slides] -- [https://homes.di.unimi.it/monga/lucidi2021/pyqb01-handout.pdf Slides (printing version)] * [https://youtu.be/MbMudMibuME Video recording] * [https://python.di.unimi.it/ CS Circles] === 2. March 5, 2021, 9:30-11:30 am * [https://homes.di.unimi.it/monga/lucidi2021/pyqb02.pdf Slides] -- [https://homes.di.unimi.it/monga/lucidi2021/pyqb02-handout.pdf Slides (printing version)] * [https://youtu.be/yteNk6SiZ1M Video recording] === 3. March 8, 2021, 9:30-11:30 am * [https://homes.di.unimi.it/monga/lucidi2021/pyqb03.pdf Slides] -- [https://homes.di.unimi.it/monga/lucidi2021/pyqb03-handout.pdf Slides (printing version)] * [https://youtu.be/MZqnuSS9M8o Video recording] === 4. March 12, 2021, 9:30-11:30 am * [https://homes.di.unimi.it/monga/lucidi2021/pyqb04.pdf Slides] -- [https://homes.di.unimi.it/monga/lucidi2021/pyqb04-handout.pdf Slides (printing version)] * [https://youtu.be/fiHB9Nk41ko Video recording] * Homework: [https://classroom.github.com/a/TpWhD1zt One triangle] === 5. March 15, 2021, 9:30-11:30 am * [https://homes.di.unimi.it/monga/lucidi2021/pyqb05.pdf Slides] -- [https://homes.di.unimi.it/monga/lucidi2021/pyqb05-handout.pdf Slides (printing version)] * [https://youtu.be/jZM0TISPicw Video recording] * Homework: [https://classroom.github.com/a/gd_s1ybQ Triangle kinds] [https://classroom.github.com/a/6AI0xnot DNA Hamming] [https://classroom.github.com/a/exi-O3Kl Newton sqrt] === 6. March 19, 2021, 9:30-11:30 am * [https://homes.di.unimi.it/monga/lucidi2021/pyqb06.pdf Slides] -- [https://homes.di.unimi.it/monga/lucidi2021/pyqb06-handout.pdf Slides (printing version)] * [https://youtu.be/Z0NHk9Z65uI Video recording] * Homework: [https://classroom.github.com/a/MhchQHAd Pythagorean triplets] [https://classroom.github.com/a/36ITXw1V Flatten list] === 7. March 22, 2021, 9:30-11:30 am * [https://homes.di.unimi.it/monga/lucidi2021/pyqb07.pdf Slides] -- [https://homes.di.unimi.it/monga/lucidi2021/pyqb07-handout.pdf Slides (printing version)] * [https://youtu.be/rGkgGOofly0 Video recording] * Homework: [https://classroom.github.com/a/5lBJ-wgC DNA files] === 8. March 26, 2021, 9:30-11:30 am * [https://homes.di.unimi.it/monga/lucidi2021/pyqb08.pdf Slides] -- [https://homes.di.unimi.it/monga/lucidi2021/pyqb08-handout.pdf Slides (printing version)] * [https://youtu.be/Px2Cqf3Ct4M Video recording] Unfortunately the first ~15' are missing: - for consolidating the basics I was suggesting [https://python.di.unimi.it CS Circles] - a book on Python (the one suggested above, there are many suggested also on CS Circles) - you can find tons of additional exercises if you want: [https://exercism.io Exercism] * Homework: [https://classroom.github.com/a/JMlHieUy DNA forensics] * Optional, provided by [https://github.com GitHub] to [https://classroom.github.com/a/KLoZ8Qxl familiarize with GitHub Classroom] (I tried it today: nothing special, but it gives you many links if you want to learn more about github) === 9. March 29, 2021, 9:30-11:30 am * [https://homes.di.unimi.it/monga/lucidi2021/pyqb09.pdf Slides] -- [https://homes.di.unimi.it/monga/lucidi2021/pyqb09-handout.pdf Slides (printing version)] * [https://youtu.be/wFeqxWqeqcQ Video recording] * No new homework, but try to finish all the assignments; if you still feel insecure on Python basics, I'm preparing some AssignmentsOnTheBasics. === 10. April 9, 2021, 9:30-11:30 am * [https://homes.di.unimi.it/monga/lucidi2021/pyqb10.pdf Slides] -- [https://homes.di.unimi.it/monga/lucidi2021/pyqb10-handout.pdf Slides (printing version)] * [https://youtu.be/0VcpSlMjWJs Video recording] * No new homework, but try to finish all the assignments; if you still feel insecure on Python basics, I'm preparing some AssignmentsOnTheBasics. === 11. April 12, 2021, 9:30-11:30 am * [https://homes.di.unimi.it/monga/lucidi2021/pyqb11.pdf Slides] -- [https://homes.di.unimi.it/monga/lucidi2021/pyqb11-handout.pdf Slides (printing version)] * [https://youtu.be/wJb7XuIe-zU Video recording] * Homework: [https://classroom.github.com/a/CO132nII NumPy basics] === 12. April 16, 2021, 9:30-11:30 am * [https://homes.di.unimi.it/monga/lucidi2021/pyqb12.pdf Slides] -- [https://homes.di.unimi.it/monga/lucidi2021/pyqb12-handout.pdf Slides (printing version)] * [https://youtu.be/vuySJRE4eHU Video recording] === 13. April 19, 2021, 9:30-11:30 am * [https://homes.di.unimi.it/monga/lucidi2021/pyqb13.pdf Slides] -- [https://homes.di.unimi.it/monga/lucidi2021/pyqb13-handout.pdf Slides (printing version)] * [https://youtu.be/Njz_3aVxhIQ Video recording]. * Homework: [https://classroom.github.com/a/XCUtqyEF Life] === 14. April 23, 2021, 9:30-11:30 am Room DELTA, MS Teams [https://youtu.be/cuJ3LDbfz2U YouTube] * [https://classroom.github.com/a/rVnWYeuZ Gray-Scott] === 15. April 26, 2021, 9:30-11:30 am * [https://homes.di.unimi.it/monga/lucidi2021/pyqb14.pdf Slides] -- [https://homes.di.unimi.it/monga/lucidi2021/pyqb14-handout.pdf Slides (printing version)] * [https://youtu.be/aqZCuUACV8s Video recording] === 16. April 23, 2021, 9:30-11:30 am Room DELTA, MS Teams [https://youtu.be/b_n8R4sXQz0 YouTube] * [https://classroom.github.com/a/gZspKbxj Numpy images] === 17. May 3, 2021, 9:30-11:30 am * [https://homes.di.unimi.it/monga/lucidi2021/pyqb15.pdf Slides] -- [https://homes.di.unimi.it/monga/lucidi2021/pyqb15-handout.pdf Slides (printing version)] * [https://youtu.be/X_ouF9s7omk Video recording] === 18. May 7, 2021, 9:30-11:30 am Room DELTA, MS Teams, [https://youtu.be/70HHk8cMDVc YouTube] (for the right formulas see the notebook: I wrote a wrong one at the whiteboard) * [https://classroom.github.com/a/_EPgU6Q0 Lotka-Volterra, part I] === 19. May 10, 2021, 9:30-11:30 am * [https://youtu.be/VYKSnniUEhI Video recording] === 20. May 14, 2021, 9:30-11:30 am Room DELTA, MS Teams, [https://youtu.be/Of1mtiTR_ks YouTube] * [https://classroom.github.com/a/T8kaWKmA Lotka-Volterra, part II] === 21. May 17, 2021, 9:30-11:30 am * [https://homes.di.unimi.it/monga/lucidi2021/pyqb16.pdf Slides] -- [https://homes.di.unimi.it/monga/lucidi2021/pyqb16-handout.pdf Slides (printing version)] * [https://youtu.be/HuuAbNP3uPA Video recording] === 22. May 21, 2021, 9:30-11:30 am Room DELTA, MS Teams, [https://youtu.be/LePesNPHm-8 YouTube] * [https://classroom.github.com/a/X0Zn0URs Analysis of Howell's data with pandas] === 23. May 24, 2021, 9:30-11:30 am * [https://homes.di.unimi.it/monga/lucidi2021/pyqb17.pdf Slides] -- [https://homes.di.unimi.it/monga/lucidi2021/pyqb17-handout.pdf Slides (printing version)] * [https://youtu.be/1HYlF3iPdFc Video recording] === 24. May 28, 2021, 9:30-11:30 am Room DELTA, MS Teams, [https://youtu.be/7D1j73elXAA YouTube] * [https://classroom.github.com/a/wwtFl3Jk Analysis of Howell's data with pandas, part II] === 25. May 31, 2021, 9:30-11:30 am * [https://homes.di.unimi.it/monga/lucidi2021/pyqb18.pdf Slides] -- [https://homes.di.unimi.it/monga/lucidi2021/pyqb18-handout.pdf Slides (printing version)] * [https://youtu.be/mFYprQmNtu4 Video recording] === 26. June 4, 2021, 9:30-11:30 am Room DELTA, MS Teams, [https://youtu.be/lhC21m5e8_E YouTube] * [https://classroom.github.com/a/ax8el8L2 Analysis of Howell's data with pymc3] === 27. June 7, 2021, 9:30-11:30 am * [https://homes.di.unimi.it/monga/lucidi2021/pyqb19.pdf Slides] -- [https://homes.di.unimi.it/monga/lucidi2021/pyqb19-handout.pdf Slides (printing version)] * [https://youtu.be/af-eughRx9o Video recording] === 28. June 11, 2021, 9:30-11:30 am Room DELTA, MS Teams, [https://youtu.be/D0U12zM140o YouTube]