Programming
Course code
DO243A (undergrad), under the Department of Oceanography
Semesters taught
113-2, 114-2 (offered every year in the second semester)
Course description
This course introduces students to basic programming concepts using Python.
Upon completion, students will be able to write their own programs in Python.
The first part of the course focuses on the basics of programming and the Python language.
Students will learn built-in data types and use conditionals and iterations to
write their first programs. We will use mostly “vanilla” Python in this part within
the command line interface to build a strong foundation.
The second part focuses on using popular external libraries. This part is useful
for students learning programming for data analysis. We will use Google Colab
to demonstrate how data can be conveniently processed, analyzed and visualized
in a notebook format.
Finally, students will be introduced to web app development to present their
ideas and let users to interact with their programs easily online.
We will use Streamlit to demonstrate. For students planning to also take
Machine learning later,
this will equip them with the skills to build an interactive web app that allows users to use their model online.
Prerequisite
None.
Syllabus
- Introduction to programming and Python basics
- Data types
- Logical operators and conditionals (if-else)
- Iterations (for loop, while loop, comprehensions, recursion)
- Function (arguments, variable scopes, testing)
- Randomization (sampling, simulation)
- Optional topics depending on progress: parallel processing, intro to programming paradigms (procedural, functional, object-oriented), regular expression
- Midterm exam and final project proposal
- Introduction to data analysis libraries and web app development
- Data frames processing with Pandas
- Data visualization
- Numerical analysis with NumPy
- Building interactive web app I
- Building interactive web app II
- Final project presentation
- Final project presentation
Web app examples
- Hand written digit predictor (embedded below)
- Typhoon track viewer
- K-means clustering visualization
- Ocean current viewer