Inspiration

We were inspired to create this website after seeing a article about the relationship between temperature and number of shark attacks. We wanted to test this theory for ourselves and see if it holds true. If we could take temperature into account when calculating the probability of a shark attack, it could have the potential to save lives.

What it does

This website gives users important information about shark attacks. It shows users how may attacks there have been in 2020 and in what state they took place. It also analyzes the relationship between temperature and shark attacks by creating a scatter plot and displaying a best fit curve. It therefore shows you the two main risk factors for a shark attack and users can apply the information to stay safe at times of higher risk.

How we built it

We built this using mainly python and html to create the frontend and back end. In python we scraped average monthly temperatures for each state where the shark attack took place in a given month. We also imported a csv with pandas and created a data frame to organize the data. Then we created a scatter plot with this data and fitted an exponential curve for shark attack/temperature relationship. We also created a front end with html, created a pie chart of all the given attacks in each state with javascript, and used php to make a contact form.

Challenges we ran into

We ran into challenges while creating the exponential curve since often obscure numbers would pop up leaving us a bit confused since the variables were correct. We ended up figuring out that we had created a syntax error and quickly fixed it, though it took a bit to find out the error.

Accomplishments that we're proud of

We are proud that we figured out how to fit a curve to our data since it did not appear to be a linear relationship. We only had knowledge of the basics of exponential curves and were proud to learn more. We are also proud of our html code and the work we put into it.

What we learned

We learned a lot about exponential curves and also gained a better understanding of php. Prior to this we had little experience with php and were glad to learn more about it.

What's next for Shark Attack Stats & Factors

Next we would love to make our website interactive. The user can put in temperature and location and we could find the probability of a shark attack. We started working on this and the relationships, but we still have to find the cut off of temperature when shark bites start to go down. We would also have to find more data for this and find attack dates and locations from previous years which are not well documented.

Share this project:

Updates