Your goal is to analyse the same earthquake data as before (#13) and produce two plots, showing:
the frequency (number) of earthquakes per year
the average magnitude of earthquakes per year
To help you off, we have suggested an outline of the code. You can change this as you want, or use your own structure.
Choose someone to share their screen and type. The other team members will tell them what to write.
Make sure that person has forked the earthquakes repository and cloned their fork locally. They should also give access to the rest of the members.
Make a new branch with your combined GitHub usernames, named plots-@username1-@username2-...
If you are not sure you have read the data correctly, you may want to look at the sample solution. You can start from that or from one of your own answers.
Take a few minutes to look at the outline given, and think about how you will structure your code. What steps do you need and how will they connect? Do you want to change the provided functions or add some more?
Write some code to produce one plot.
When you are finished (or have done as much as you can), push your code, and open a Pull Request to the original earthquakes repository. Include the text Answers UCL-COMP0233-22-23/RSE-Classwork#17 in the description to link it to this issue. Add one or both plots if you want!
If you have time, continue with the other plot and add it to the PR!
Some hints:
You can do the computations required in "plain" Python, but think about using the numpy library (the unique function or others could be helpful, depending on how you have approached the problem)
For plotting:
Make sure you have computed the values you need to plot!
Choose an appropriate plot type (if you need inspiration, there are various galleries) and then see how to create that in matplotlib.
See whether you need to put your data in a particular form to create the plot.
After plotting, do you need to make any visual adjustments? (on, for example, the axes, labels, colours...)
Your goal is to analyse the same earthquake data as before (#13) and produce two plots, showing:
To help you off, we have suggested an outline of the code. You can change this as you want, or use your own structure.
plots-@username1-@username2-...
earthquakes
repository. Include the textAnswers UCL-COMP0233-22-23/RSE-Classwork#17
in the description to link it to this issue. Add one or both plots if you want!Some hints:
numpy
library (theunique
function or others could be helpful, depending on how you have approached the problem)matplotlib
.Sample solution