**CIS 1920: Python Programming 🐍**
**Spring 2023**
Welcome! Python is a powerful language with both imperative and functional paradigms. As one of the fastest growing languages of all time, Python is widely used across academia and industry. Our goal with this course is to familiarize you with Pythonic coding principles as well as introduce you to the wide use cases of Python and its packages. (#) Logistics - **Time**: Thursdays 8:30am - 10:00 am ET - **Location**: Towne 315 - **Instructor**: Tony Liu - **Teaching Assistant**: Nichole Chau - **Office Hours (Zoom links on Ed)** - Tony: - Thursdays 3:00pm - 4:30pm - Nicole: - Wednesdays 4 - 5pm - Fridays 3:30pm - 4:30pm (#) Schedule Lecture slides, recordings, and assignments will be linked below. Exact due dates for assignments will be shown in Gradescope, but in general: - Assignments will be released after lecture on Thursdays - Homeworks (HW) will be due the following **Friday at 11:59pm ET** - Worksheets (WS) will be due the following **Wednesday at 11:59pm ET** (##) Pythonic Foundations | Date | Topic | Optional Readings |Assignments | |-------|--------------------------------------------------------------------------------------|------------------------------------------|----------------------------------------| | 1/12 | Logistics, Python Basics
[[**pdf**](lectures/wk01_intro.pdf)] [[**recording**][wk01]] | [What is Python?][whatispython] | [WS 1](worksheets/ws1.html): due 1/18 | | 1/19 | Data Structures
[[**pdf**](lectures/wk02_data_structures.pdf)] [[**recording**][wk02]] | | [HW 1](hws/hw1.html): due 1/27 | | 1/26 | Pythonic Programming I
[[**pdf**](lectures/wk03_pythonic1.pdf)] [[**recording**][wk03]] | [Namespaces][namespaces] | [WS 2](worksheets/ws2.html): due 2/1 | | 2/2 | Pythonic Programming II
[[pq.py](demos/pq.py)] [[pq_solution.py](demos/pq_solution.py)]
[[python_zen.txt](demos/python_zen.txt)]
[[**pdf**](lectures/wk04_pythonic2.pdf)] [[**recording**][wk04]] | | [HW 2](hws/hw2.html): due 2/10 | | 2/9 | Modules, Testing, Scripting
[[generators.py](demos/generators.py)] [[solution](demos/generators_solution.py)]
[[test_gen.py](demos/test_generators.py)] [[solution](demos/test_generators_solution.py)]
[[wiki.py](demos/wiki_summary.py)] [[solution](demos/wiki_summary_solution.py)]
[[**pdf**](lectures/wk05_testing.pdf)] [[**recording**][wk05]]| | [HW 3](hws/hw3.html): due ~~2/17~~ 2/20 | (##) Data Science | Date | Topic | Optional Readings | Assignments | |---------------|--------------------------------------------------------------------------------------|----------------------------------------|-----------------------------------------| | 2/16 | Scientific computing: NumPy
[[**pdf**](lectures/wk06_numpy.pdf)] [[**recording**][wk06]] | | [WS 3](worksheets/ws3.html): due 2/24 | | 2/23 | Plotting & Machine Learning
[[plot_ml.py](demos/plot_ml.py)] [[solution](demos/plot_ml_solution.py)]
[[ml_utils.py](demos/ml_utils.py)]
[[**pdf**](lectures/wk07_ml.pdf)] [[**recording**][wk07]] | [A few things about
machine learning][machine_learning] | [HW 4](hws/hw4.html): due 3/3 | | 3/2 | Jupyter Notebooks/Pandas
**Zoom lecture, link on Ed**
[[demo colab](https://colab.research.google.com/drive/1lGqwyG8IRJaujNPO2b_GQCl4zA-g3We9?usp=sharing)] [[solution](https://colab.research.google.com/drive/14tx2K-yuaMOQqAUPtMNs9r0Bsyig3pcx?usp=sharing)]
[[stack_overflow.zip](demos/stack_overflow.zip)]
[[**pdf**](lectures/wk08_jupyter.pdf)] [[**recording**][wk08]]| | [WS 4](https://colab.research.google.com/drive/1ak5GT4rXSBbIBN7zD0BPis8RF2NW7VS4?usp=sharing): due 3/15
[Final project released](project.html) | | 3/9 | 🌼 Spring break 🌷 | | | | 3/16 | Deep Learning
[[demo colab](https://colab.research.google.com/drive/1k6ocyH1f0Zldni1wMPRRNIrL_vUARN2M?usp=sharing)] [[solution](https://colab.research.google.com/drive/1c6zytilUfsgBE5H7lAyCULOjGZRhNqPJ?usp=sharing)]
[[**pdf**](lectures/wk10_dl.pdf)] [[**recording**][wk10]] | | [HW 5 part 1](https://colab.research.google.com/drive/1TnAKHkUyvHUDst95FHflpELGcmWfL3IW?usp=sharing): due 3/31
[Milestone 1](project.html): due 3/24| (##) Web Development | Week | Topic | Optional Readings | Assignments |--------------|--------------------------------------------------------------------------------------|------------------------------------------|-----------------------------------------| | 3/23 | Web Scraping
[[demo colab](https://colab.research.google.com/drive/1U2Uova8w8q7RcOSL_4O7d0KxNFCEp2-k?usp=sharing)] [[solution](https://colab.research.google.com/drive/1oNC0c7O-hLlbIcD2S4fith2MMtfoJr0g?usp=sharing)]
[[mnist_model.pkl](https://www.seas.upenn.edu/~cis1920/tliu/s23/demos/mnist_model.pkl)]
[[**pdf**](lectures/wk11_web_scraping.pdf)][[**recording**][wk11]] | [Scraping
Hospital Prices][hospital_scraping] | [HW 5 part 2](https://colab.research.google.com/drive/1Dq-8X3DOBA0V64K_1VdwZzldU00vou3g?usp=sharing): due 3/31 | | 3/30 | Flask
[[demo zip](demos/wk12.zip)]
[[**pdf**](lectures/wk12_flask.pdf)] [[**recording**][wk12]] | | [HW 6](hws/hw6.html): due 4/14 | | 4/6 | Flask and Django
[[demo zip](demos/wk13.zip)]
[[**pdf**](lectures/wk13_flask_django.pdf)] [[**recording**][wk13]] | | | | 4/13 | Docker for App Deployment
[[Dockerfile](demos/Dockerfile)]
[[**pdf**](lectures/wk14_docker.pdf)] [[**recording**][wk14]] | | [WS 5](worksheets/ws5.html): due ~~4/19~~ 4/21 | | 4/20 | Lightning topics
and course wrap-up
[[**pdf**](lectures/wk15_wrap_up.pdf)] [[**recording**][wk15]] | | | | | Final Project Milestone 2
due ~~4/28~~ **4/30** | | | (#) Syllabus A list of the topics we will cover can be found below. Note that topics are subject to change. - **Pythonic Foundations** - Data structures and file I/O - Exceptions, modules, and OOP - Virtual environments and workflows - Testing and scripting - **Data Science and Machine Learning** - Data manipulation using NumPy and Pandas - Data visualization using Matplotlib and Seaborn - Machine learning with Scikit-learn - Deep learning with Pytorch - **Web Development and Deployment** - REST APIs with Flask - Web dev with Django - Cloud deployment with Docker - Web scraping (#) Course Policies (##) Communication We will primarily use Ed for discussion outside of lecture and office hours. The system is highly catered to getting you help fast and efficiently from classmates and the teaching staff. Rather than emailing, we encourage you to post your questions on Ed. (##) Grading The grading breakdown is as follows: - Six homeworks (60%) - Final project (25%) - Completion-graded worksheets (10%) - Participation (5%) (##) Late assignments Everybody gets **five late days for homeworks**, and **up to two** can be used for a single assignment. We'll track late submissions via Gradescope and will record your late day usage automatically, though definitely feel free to ask us at any point in the semester how many late days you have remaining. Beyond these, any late day will incur a penalty of 20% as of the change of date. Late days only apply to homeworks, so they may not be used for worksheets or the final project. (##) Collaboration You are permitted (and encouraged) to discuss the homework problems with other class members, but these discussions are to be limited to high-level concepts. **In particular, you are absolutely not permitted to copy/share code or implementation details**. Similarly, you are not permitted to use or consult code found on the internet for any of your assignments. The only context where it is permitted to share code is during the final project, during which you are allowed to collaborate with your team members. (#) Attribution and Licensing This course would not be possible without the lecture and homework content created by [Arun Kirubarajan](https://kirubarajan.com/) and [Jorge Mendez](https://www.seas.upenn.edu/~mendezme/). You are free to use or extend these projects for educational purposes provided that: 1. you do not distribute or publish solutions 2. you retain this notice 3. you provide clear attribution to the University of Pennsylvania, including a link to https://www.cis.upenn.edu/~cis1920/ [whatispython]: https://www.python.org/doc/essays/blurb/ [namespaces]: https://docs.python.org/3/tutorial/classes.html#python-scopes-and-namespaces [three_tdd]: https://blog.cleancoder.com/uncle-bob/2014/12/17/TheCyclesOfTDD.html [matplotlib]: https://ryxcommar.com/2020/04/11/why-you-hate-matplotlib/ [hospital_scraping]: https://www.npr.org/sections/health-shots/2022/07/27/1113091782/health-insurance-prices-for-care-are-now-out-there-but-finding-them-is-an-ordeal [machine_learning]: https://homes.cs.washington.edu/~pedrod/papers/cacm12.pdf [excavatingai]: https://excavating.ai/ [wk01]: https://upenn.zoom.us/rec/share/r6Om0mgtm_fjN14KYZBx4d2TOod71-sy29uYoza3p-u8-7hccgC1KFHNgSJNaeGG.zNXcb0gRigok_EQ2 [wk02]: https://upenn.zoom.us/rec/share/SKsxCrnxcMzA0ewyP4Hpo6SfEi-y-5HiT9stXSN4b0ddWWUef-l8_T8yikKN6hix.apb_JNqcAt-rf741 [wk03]: https://upenn.zoom.us/rec/share/MTgD9R1ck-vlpeut-R_pkkGB84eMADtVfmgKBmTJO9RUBCC9Stq2Yvgn3stc3WDI.h5oRRGcRUc99oggk [wk04]: https://upenn.zoom.us/rec/share/3a6DqeAr2xPhk8gDfpFjT9-UuNdJyWBsKXL3X0vYjwwe4IHKMQylRL5bGlUEIimf.m3Xwqj5uLTgJkb4N?startTime=1675344643000 [wk05]: https://upenn.zoom.us/rec/share/1cPTRuiWU1Lh6dmrewTdzJphW4WTSVeFBSedg1KBmFZwf5bL2B3ykBY2aD4NtZ-c.ukjmGPsiSDXwGiqC [wk06]: https://upenn.zoom.us/rec/share/AB8rmFAVi1NLoWN53tuZnpIUbtoaOIGGMiL8rCTCaHHm1LdF8YxtNQBZkr8utTwt.--IV99H78FAvw_5Y [wk07]: https://upenn.zoom.us/rec/share/3BTC6Jpc2bfUieM-cHnv9FnOtEJqamDGl3vNiW99ltjWBQbX3EK2641CH2shOesn.pPdVwtprP9deIoi0 [wk08]: https://upenn.zoom.us/rec/share/gAAYI7CX2SrJjzjcH8lVB0be8e9MS8OJiCUGyw1QzRidyek22S-vnbt6pDEBlsVf.uptY0QMXewjXx6-i [wk10]: https://upenn.zoom.us/rec/share/4FjIh-B5KBf3USPdWAVq60lwo4-tePsQi-w2YXqDfpOTZ-Q757KTqNPTSkhEgvPL.AUlasD3Tz_Hyj3Fo [wk11]: https://upenn.zoom.us/rec/share/w0m5iuzbOZYvx1ew6CtLpo02l_WaIaYVkZj0s7hDCpCmO2mOOhEgMgcMAEJxk3Lx.dvaqNVi6LAqiwQ-D [wk12]: https://upenn.zoom.us/rec/share/DhCRGEHziNfcch05N1GxQP35T_rIVirB5dB8y70hQKendzmkWmqkjagHBLSV7y44.2MnScTRqxfWvGoUN [wk13]: https://upenn.zoom.us/rec/share/Rv1spHnLya6nEmhzYVA0e2RVcNJuEiS7BeXHglYZx2nDgnGKMiXNZ7re7U_NY284.FGjauNTqdxkjT0fx [wk14]: https://upenn.zoom.us/rec/share/ujirAktFuzgj6pfdS5hhQ_PzXDcc9TX7py3V1yjmXWsOJw6PTi5ms0s9BG1duEPi.WBmxOBI1L4PjIYOq [wk15]: https://upenn.zoom.us/rec/share/4WwfY6NYw4QsAq-_hIeAgBuivZJv6Z_5KeGjMRVsXxOZrxVj4etgbcwPQVKwx5SR.DGDR3Dd4GBSGAhnz