Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Week 4 Preparation issue9 - Largest Earthquake in UK #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dp0768
Copy link

@dp0768 dp0768 commented Oct 18, 2024

Here is my solution to Issue #9 for RSE classwork.

I found it most difficult to convert the website data into a Python dictionary object. My script fetches the data in the geojson format, but this is not suitable for Python and can't simply be passed into json.dumps(). However, I found out that response has an attribute which converts the geojson data to the correct format by typing "response." and then the following list appeared:
image

Technically, I didn't have to pass the new variable (response_json) into a json.dumps(), however, I did do this so I could alter the formatting in the json file. That way the format was much more user-friendly allowing me to more easily complete the rest of the task.

My final response:

Loaded 120 events
The strongest earthquake was at [-2.15, 52.52] with magnitude 4.8

Answers UCL-COMP0233-24-25/RSE-Classwork#9

@r4b61t
Copy link

r4b61t commented Oct 20, 2024

I didnt know about the json method of the response. Thats really cool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants