✏️ W04 Formative - A little Python challenge
2023/24 Winter Term
⏲️ Due Date:
- 7 February 2024 at 5pm (London time)
🎯 Main Objectives:
- Practice some more Git/GitHub
- Practice editing and structuring Jupyter Notebooks
- Practice writing and editing markdown
- Practice writing Python code
💡 TIP
Please submit your work even if you didn’t manage to go very far with the Python code. As this is a formative assignment, it won’t be graded, and you can still benefit from learning how to use GitHub effectively
👉 Note: This assignment will count towards your final class grade if you are a General Course or Exchange student.
📚 Preparation
Find the GitHub assignment link: Go to our Slack workspace’s
#announcements
channel.Accept the assignment: Click the link, sign in to GitHub, and click the green button.
Access your private repository: You’ll be redirected to a new private repository named
ds105w-2024-w04-formative-<yourusername>
.Don’t stress about completing everything: It’s okay if you’re still learning Python and GitHub. Your submission will count as completed even if you don’t answer all the questions.
Get help in #help-assessments: Ask questions in this public channel on Slack.
Additional notes:
- Jupyter Notebooks accepts the same markdown syntax as GitHub.
- We’ll prioritise questions asked in public channels over private DMs.
📚 Tasks
The questions below will build on principles from the 💻 W03 Lab and the 👨🏻🏫 W03 lecture but will also draw on some of the Python knowledge you have acquired in the pre-sessionals. In particular, you will need to
📝 Task 1: Set up (20 fake marks)
Clone your repository: Clone your repository to your computer.
Install the required packages: On the terminal and install the Faker package by running the following command:
pip install faker
Run the script provided: Then, inside the folder associated with your repository, run:
python3 code/generate_fake_data.py
This will produce a new file at
data/customers_and_transactions.json
.Commit and push your changes. It’s OK to commit and push multiple times if needed.
📝 Task 2: Fill in the blanks (40 fake marks)
Open the Jupyter Notebook provided: You will find it at
notebooks/NB01 - Initial Data Analysis.ipynb
.Add your candidate number: Double-click the first cell and replace
<YOUR-CANDIDATE-NUMBER>
with your candidate number.Fill in the blanks in Section 1: Section 1 has no code cells, only markdown cells. Click each and every one of them to identify
<blank>
placeholders. Replace each<blank>
with the correct answer.Save, commit, and push your changes. It’s OK to commit and push multiple times if needed.
📝 Task 3: Write some code (40 fake marks)
Fill in the blanks in Section 2: Section 2 has code cells. Click each and every one of them to identify
<blank>
placeholders. Replace each<blank>
with the correct answer.Acknowledge any use of generative AI: It’s absolutely fine to use generative AI for any assignment in this course. However, you MUST declare any use of generative AI in your assignment. At the end of the notebook, you will find a declaration cell.
Save, commit, and push your changes. It’s OK to commit and push multiple times if needed.
“What do I submit?”
You don’t need to click to submit anything!
Your assignment is automatically submitted when you commit
and push
your changes to GitHub. Feel free to git push
multiple times before the deadline — we’ll only grade the final version.
We will expect to see the following file structure in your repository:
ds105w-2024-w04-formative-<yourusername>
├── README.md (as provided)
├── .gitignore (as provided)
├── code/generate_fake_data.py (as provided)
├── notebooks/NB01 - Initial Data Analysis.ipynb (modified by you)
└── data/customers_and_transactions.json (created by you)
✔️ How we will grade your work
We won’t! This is formative. But you will get feedback on your answers. It won’t be super detailed at this stage, but it should give you an idea of how you are doing.
👉 Note: Completing this assignment will count towards your final class grade if you are a General Course or Exchange student. It will still count as submitted even if you submit just a few coding responses.