import mikeio1d
print("I'm a script that uses mikeio1d version " + mikeio1d.__version__)
Homework
Exercise 1
- Create a GitHub account.
- Find and explore the mikeio1d repository. Can you find its documentation?
- What’s the current version of mikeio1d?
- Search around GitHub and star some repositories you think are cool.
Exercise 2
- Make a new folder somewhere on your PC.
- Open the folder in Visual Studio Code.
- Create a virtual environment in that folder using uv from VS Code’s terminal.
- Install mikeio1d in the virtual environment using uv.
- List all the packages in the virtual environment. Do you recognize any?
- Select the Python Interpreter in VS Code to be the virtual environment you created.
Exercise 3
- From VS Code, create a new .py file under the project folder created in exercise two.
- Copy the following code into the script:
- Run the script from VS Code’s terminal using uv.
- Run the script from VS Code’s user interface (i.e. via the ‘Run’ menu).
- Do you get the same output for steps 3 and 4?
Exercise 4
- Install
ipykernel
into the same virtual environment of the previous exercises. - Create a new Jupyter Notebook from within VS Code.
- Make sure the kernel matches your virtual environment, otherwise update it.
- Paste the code from exercise three into a code cell.
- Run the cell created in the previous step. Does the output match that of exercise three?
Exercise 5
- Install the package
cowsay
into your virtual environment. - Create a new script, and import the function
cow
fromcowsay
. - Make a list containing the names of three countries you want to visit.
- Loop over the list, and invoke the function
cow
by passing the current element of the list. - Run the script. What do you see?
- Try to get the same output in a jupyter notebook by using two code cells.
Exercise 6
- Download this time series csv file into your project folder.
- Install
pandas
andmatplotlib
into your virtual environment. - Create a new Jupyter Notebook and import pandas
- Load the downloaded csv file into a DataFrame using pandas.
- Calculate the minimum, mean, and maximum values.
- Plot the DataFrame. Do the values calculated from the previous step make sense?
Practice Exercises (optional)
- Jupyter Notebook covering Python basics
- Jupyter Notebook covering NumPy
- Jupyter Notebook covering Pandas
- Jupyter Notebook covering Matplotlib
Want to check your work?
Download the exercise solutions: