**CIS 192: Python Programming 🐍**
**Fall 2021**
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**: (Section 201) Thursdays 8:30am - 10:00 am ET, Towne 309 - **Instructor**: [Tony Liu](http://kordinglab.com/people/tony_liu/index.html) - **Teaching Assistant**: Abel Chacko - **Office Hours**, Zoom links on Piazza: - Thu 2 - 3pm: Abel Chacko - Thu 3 - 5pm: Tony Liu - Fri 11am - 12pm: Abel Chacko (#) 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 | Week | Topic | Optional Readings |Assignments | |--------------|--------------------------------------------------------------------------------------|------------------------------------------|----------------------------------------| | Wk 1 - 9/9 | Logistics, Python Basics
[[pdf](lectures/wk01_intro.pdf)] [[recording][wk01]] | [What is Python?][whatispython] | [WS 1](worksheets/ws1.html): due 9/15 | | Wk 2 - 9/16 | Data Structures
[[pdf](lectures/wk02_data_structures.pdf)] [[recording][wk02]] | | [HW 1](hws/hw1.html): due 9/24 | | Wk 3 - 9/23 | Pythonic Programming I
[[pdf](lectures/wk03_pythonic1.pdf)] [[recording][wk03]] | [Namespaces][namespaces] | [WS 2](worksheets/ws2.html): due 9/29 | | Wk 4 - 9/30 | Pythonic Programming II
[[pdf](lectures/wk04_pythonic2.pdf)] [[recording][wk04]]
pq.py: [[starter](lectures/wk04/pq.py)] [[solution](demos/pq.py)]
[[python_zen.txt](lectures/wk04/python_zen.txt)] | | [HW 2](hws/hw2.html): due 10/8 | | Wk 5 - 10/7 | Modules, Testing, Scripting
[[pdf](lectures/wk05_testing.pdf)] [[recording][wk05]]
[[requests demo][wk05_requests]]
generators.py:
[[starter](lectures/wk05/generators.py)] [[solution](demos/generators.py)]
test_generators.py:
[[starter](lectures/wk05/test_generators.py)] [[solution](demos/test_generators.py)]
wiki_summary.py:
[[starter](lectures/wk05/wiki_summary.py)] [[solution](demos/wiki_summary.py)] | [The 3 rules of TDD][three_tdd] | [HW 3](hws/hw3.html): due ~~10/22~~ 10/24 | (##) Data Science | Week | Topic | Optional
Readings |   Assignments   | |-----------------|--------------------------------------------------------------------------------------|------------------------------------------|-----------------------------------------| | Wk 6 - 10/14 | 🍂 **Fall break** 🍂 no class | | | | Wk 7 - 10/21 | Scientific computing:
NumPy, Matplotlib
[[pdf](lectures/wk07_numpy_matplotlib.pdf)] [[recording][wk07]] | [Why you hate matplotlib][matplotlib] | [WS 3](worksheets/ws3.html): due 10/27 | | Wk 8 - 10/28 | Machine Learning
[[pdf](lectures/wk08_ml.pdf)] [[recording][wk08]]| [A few things about machine learning][machine_learning] | [HW 4](hws/hw4.html): due 11/5 | | Wk 9 - 11/4 | Jupyter Notebooks/Pandas
[[Colab demo][wk09_colab]]
[[pdf](lectures/wk09_jupyter.pdf)][[recording][wk09]] | | [WS 4][ws4]: due 11/10 | | Wk 10 - 11/11 | Deep Learning
[[pdf](lectures/wk10_dl.pdf)][[recording][wk10]] | | [HW 5][hw5]: due 11/19
[**Final project**](project.html):
Milestone 1 due 11/24 | (##) Web Development | Week | Topic | Optional
Readings |   Assignments   |--------------|--------------------------------------------------------------------------------------|------------------------------------------|-----------------------------------------| | Wk 11 - 11/18| Web Dev with Flask
[[pdf](lectures/wk11_flask.pdf)][[recording][wk11]]
[[server.py](demos/server.py)] [[answer.html](demos/answer.html)]
[[pokedex.py](demos/pokedex.py)] [[pokedex.html](demos/pokedex.html)] | [Excavating AI: the politics of images in ML datasets][excavatingai] | [HW 6](hws/hw6.html): due 12/3 | | Wk 12 - 11/23| Web Dev 2: Flask and Django
[[pdf](lectures/wk12_flask_django.pdf)][[recording][wk12]]
[[pokedex.py](demos/wk12/pokedex.py)] [[pokedex.html](demos/wk12/pokedex.html)]
[[upload.html](demos/wk12/upload.html)] | | Milestone 1
due 11/24 | | Wk 13 - 12/2 | Docker for App Deployment
[[pdf](lectures/wk13_docker.pdf)] [[recording][wk13]]
[[Dockerfile](demos/Dockerfile)] | | [WS 5](worksheets/ws5.html): due 12/10 | | Wk 14 - 12/9 | Lightning Topics
[[pdf](lectures/wk14_wrap_up.pdf)] [[recording][wk14]] | | | | | Final Project Milestone 2 due ~~12/10~~ 12/14 | | | (#) 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 (#) Course Policies (##) Communication We will primarily use Piazza 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 Piazza. (##) 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/~cis192/ [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.wsj.com/articles/hospitals-hide-pricing-data-from-search-results-11616405402 [machine_learning]: https://homes.cs.washington.edu/~pedrod/papers/cacm12.pdf [excavatingai]: https://excavating.ai/ [wk01]: https://upenn.zoom.us/rec/share/3RVUFsLUrJ5n1CD1HTHZ4qKYQWOTNOAIDnAMHJUOyNy7SFXNKA-f2kV9Iaw2umiZ.Ugptt_UgdWu4MnJs [wk02]: https://upenn.zoom.us/rec/share/hNCIqLGtIlXfAfS_mgDq1hXK6vMePyNbPq4CnorvNBHjcZ2f_SvefaMJUNdmRwyP.uRnBkWgjh3glad39 [wk03]: https://upenn.zoom.us/rec/share/Hkrql9zOBwhm3cM_ekDrXZ2bnP2cSKZh9NZ0Mdd2htGpPyrt5gQ6MxGYjaMVWloj.cZX2h9z7u9eYmVGq [wk04]: https://upenn.zoom.us/rec/share/hMQxph8ZVZVQFamjg2eJooLcz4A6Z_4cl7T9Ab_Zx_98E2jslkRJBI4_h17Gftjq.a5cGn-_buMJygH9O [wk05]: https://upenn.zoom.us/rec/share/gQQWsAGtX_VIrkN1WWmp4H5fNLQB6vfw6TAvipJVFGuNbLvTdYDfSdFIIHzCxf2I.DGo4OvIK4Mk7t84C [wk05_requests]: https://upenn.zoom.us/rec/share/RmyGYh2KLMo_RRlANpXozeA5QOJzY4Z6tgxAQEukIEid0ugxlhKa-BkfTYGuapUG.1YWSLry_a09EWa9f [wk07]: https://upenn.zoom.us/rec/share/luypEJjAU0zdsFH0w_HVhfMMhnFiQsqW6LhW-IT6yKv-R4YTJXUCSN0ZlQqLQkTb.2gB-f-JXRIzE4UxH [wk08]: https://upenn.zoom.us/rec/share/5bnnXvhH8bTYVneISWRYgHQD6bnpKc31crRmzM_2lb1b2My7amngFq71UVr_1Y6G.DEf9k6WOHXJJNPo0 [wk09]: https://upenn.zoom.us/rec/share/8C0Q9XOpIizOXDPE-5JdruD8w0scb3WySSfxjBQKhNtQWY3HqMDWC4pj5eIdRMMd.SjoWtjqRPfKY2RpL [wk09_colab]: https://colab.research.google.com/drive/1WbIUvn9tqncVU7z0uhxrVd5I2DUDIFe7?usp=sharing [wk10]: https://upenn.zoom.us/rec/share/N3gGlW1wROQM7xzdPtjw1maU39IvyIH7qQdkZtxirnfZgoIIQCfFJ4ZimC47TPmJ.7cWsbI2wUOCeWQDA [wk11]: https://upenn.zoom.us/rec/share/gLhSe_xajYvyhXACZI20U31kmSxjAZkA0B97KdZxjJYxDfHnuFHt0U1cssEUT0oB.IB_a_Dzms1h9bO2U [wk12]: https://upenn.zoom.us/rec/share/bqn2zbYtrgVK4t7d3B6mE7FzOUqe25i3ux1Bom69I1z6KE8EBS6cmhyz8yqpS3I.ubZGx0ETcxXh6vi2 [wk13]: https://upenn.zoom.us/rec/share/kE2PG0e83XZfg4orL4ho5PAKpoONbA3INwSZJzpQdllLzSGAe6yBbyMoe6zeyNQ.nf35f25nfR84qNhN [wk14]: https://upenn.zoom.us/rec/share/tUH0LFYnUTMvml3vqTDVF8GXeqsSfrnUsUzO4wRX5boBrDCkm-DlEn88WbPwEd5Q.baZnm-pbVX-CmRy5 [ws4]: https://colab.research.google.com/drive/11QEBa6WorqZ_XquRI_1PvCqNJ72JFKDP?usp=sharing [hw5]: https://colab.research.google.com/drive/15u4wTiQAtL6d10_Mdb5-iqD3HG-GiYRi?usp=sharing