https://github.com/hsma-programme/h6_1f_python_part_2
Materials for HSMA 6 Session 1F
https://github.com/hsma-programme/h6_1f_python_part_2
Last synced: 11 months ago
JSON representation
Materials for HSMA 6 Session 1F
- Host: GitHub
- URL: https://github.com/hsma-programme/h6_1f_python_part_2
- Owner: hsma-programme
- License: other
- Created: 2024-01-30T09:58:20.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-15T12:34:07.000Z (over 1 year ago)
- Last Synced: 2024-05-16T02:19:06.192Z (over 1 year ago)
- Language: Jupyter Notebook
- Size: 55.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
This repository contains the materials for HSMA 6 Session 1F - Python Programming part 1
The notebooks in the h6_1f_python_part_2 can be downloaded and run locally if you have Python installed.
Alternatively, you can run each exercise on **Google Colab**, a free online platform for coding exercises. You will need to be logged in to a google account in your browser.
Using the links below will open a fresh copy of the notebook to work on - your changes will not be visible to anyone else. However, if you want to be able to refer back to your version of the notebook in future, make sure you click **'File --> Save to Drive'**.
Your changes will then be saved to your own account, and you can access your edited copy of the notebook from https://colab.research.google.com/.
**Note: when you first run a cell, you will need to click 'run anyway' in the popup that appears. This is a standard pop-up that appears for any notebook you haven't created from scratch yourself!**
---
Open Exercise 1 in Google Colab:
---
Open Exercise 2 in Google Colab:
*Hint*: To access the file **input_data.csv** in colab, you will need to upload it to Google Colab.

1. Click on 'files' in the left hand bar in Google colab (the folder-shaped icon)
2. Choose 'upload to session storage'
3. Select the file 'input_data.csv' from your machine. You can download it if required - [right click on this link and choose 'save file as'](https://raw.githubusercontent.com/hsma-programme/h6_1f_python_part_2/main/1f_python_programming_part_2/input_data.csv)
4. Click 'ok' if a warning message appears. input_data.csv should now appear in your list of files. Hover over it and three dots will appear - click on these.
5. Choose 'copy path' to get the filepath of the csv file. You can then right click and choose 'paste' in a code cell to get the filepath you will need in your code.
---
Open Exercise 3 in Google Colab:
---
Open Exercise 4 in Google Colab:
*Hint*: If running exercise 4 in Google Colab, you can point towards the titanic dataset csv on the HSMA repository. The following will work:
```
pd.read_csv("https://raw.githubusercontent.com/hsma-programme/h6_1f_python_part_2/main/1f_python_programming_part_2/titanic_dataset.csv",
#INSERT THE REST OF YOUR IMPORT CODE HERE)
```