✏️ W04 Formative - A little Python challenge

2023/24 Winter Term

Author

⏲️ Due Date:

🎯 Main Objectives:

💡 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

  1. Find the GitHub assignment link: Go to our Slack workspace’s #announcements channel.

  2. Accept the assignment: Click the link, sign in to GitHub, and click the green button.

  3. Access your private repository: You’ll be redirected to a new private repository named ds105w-2024-w04-formative-<yourusername>.

  4. 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.

  5. 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)

  1. Clone your repository: Clone your repository to your computer.

  2. Install the required packages: On the terminal and install the Faker package by running the following command:

    pip install faker
  3. 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.

  4. 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)

  1. Open the Jupyter Notebook provided: You will find it at notebooks/NB01 - Initial Data Analysis.ipynb.

  2. Add your candidate number: Double-click the first cell and replace <YOUR-CANDIDATE-NUMBER> with your candidate number.

  3. 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.

  4. 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)

  1. 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.

  2. 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.

  3. 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.