Studio 1: Working with Jupyter Notebooks on JupyterHub
In this exercise, you will practice basic operations in Jupyter notebooks, including writing and running Python code, working with Markdown cells, and performing simple data operations.
1. Setting Up the Notebook
- Create a new notebook.
- Rename it to
GroupX.ipynbwhereXis your group number.
Add some structure at the top cells:
# Group Exercise 1
This notebook is for practicing basic operations in Jupyter notebooks. It includes examples of using Python code and Markdown cells to document the work.Add a subsection with the name Team and underneath the subsection add a bulleted list with the names of the team members.
Put the leader’s name in bold.
Add a second subsection that contains a second bulleted list. Give the subsection the title Links In this list add a link to a site that each group member suggests as interesting to the class.
2. Basic Code Operations
In this section, you’ll write and run some simple Python code.
# Task 1: Print a welcome message
print("Welcome to JupyterHub!")# Task 2: Perform a simple arithmetic operation
10 * 3print(f'The value 10 * 3 is equal to {10 * 3}')Run these cells, and explore what happens as you change some of the values.
Create some new code cells that extend on these ideas.
3. Working with Data
In this section, you’ll work with a small dataset.
Load and Display the Dataset
data = [100, 20, 90, 40, 50, 30, 10]
# Display the dataset
dataPerform a Basic Analysis
# Task: Calculate the sum of the numbers in the dataset
sum(data)# Task: Calculate the mean of the numbers in the dataset
mean_value = sum(data) / len(data)
mean_valueHow would you sort the data using python? Show your answer in a code cell.
As a group, come up with an answer to the questions: Is the data skewed? If so, in what way? Add Markdown cells that describe your reasoning used to come up with your answers.
4. Documenting the Analysis
Use Markdown cells to document your code and results. For example:
## Dataset Analysis
We loaded a dataset containing the numbers 10, 20, 30, 40, 50, 90, 100. Below is the sum and mean of these numbers.
With regard to skewness, we find ....5. Final Touches and Submission
Review your notebook as a group. Ensure that it is well-organized and the code is properly documented. Use the ability to move cells around to reorganize as needed.
Once done, save your notebook as a pdf.
Have the group leader turn the pdf in on canvas.