
Sea Level Predictor
- Summary: A FreeCodeCamp challenge for a Python app that parses a CSV file and visualize the data as a scatter plot with with best fit lines using Matplotlib.
- Source URL: https://replit.com/@michellemtchai/sea-level-predictor
- Stacks:
Objective
Complete a Python assignment and passes all the tests provided by FreeCodeCamp
Original Challenge: https://www.freecodecamp.org/learn/data-analysis-with-python/data-analysis-with-python-projects/sea-level-predictor
Assignment
You will anaylize a dataset of the global average sea level change since 1880. You will use the data to predict the sea level change through year 2050.
Use the data to complete the following tasks:
- Use Pandas to import the data from
epa-sea-level.csv. - Use matplotlib to create a scatter plot using the
Yearcolumn as the x-axis and theCSIRO Adjusted Sea Levelcolumn as the y-axix. - Use the
linregressfunction fromscipi.statsto get the slope and y-intercept of the line of best fit. Plot the line of best fit over the top of the scatter plot. Make the line go through the year 2050 to predict the sea level rise in 2050. - Plot a new line of best fit just using the data from year 2000 through the most recent year in the dataset. Make the line also go through the year 2050 to predict the sea level rise in 2050 if the rate of rise continues as it has since the year 2000.
- The x label should be
Year, the y label should beSea Level (inches), and the title should beRise in Sea Level.


