Skip to content

Python script that performs data visualization on sea level rise using the Pandas and Matplotlib libraries.

Notifications You must be signed in to change notification settings

Mabdullahatif/SeaLevel_Predictor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Sea Level Predictor

Introduction

This repository contains a Python script that performs data visualization on sea level rise using the Pandas and Matplotlib libraries. The script reads sea level data from a CSV file, creates a scatter plot with lines of best fit, and visualizes the rise in sea levels over time.

Table of Contents

Code Description

The Python script performs the following tasks:

  1. Imports necessary libraries: pandas, matplotlib.pyplot, and scipy.stats.linregress.

  2. Reads sea level data from a CSV file using Pandas.

  3. Creates a scatter plot with sea level data points.

  4. Calculates and plots the line of best fit using all data from 1880 to 2050.

  5. Calculates and plots the line of best fit using data from the year 2000 onwards.

  6. Adds labels, title, and legend to the plot.

  7. Saves the plot as an image file and returns the plot object.

Key Points / Learning

  • Data Visualization: The script showcases the use of Matplotlib library for creating visualizations.

  • Line of Best Fit: The script demonstrates how to calculate and plot lines of best fit for the sea level data.

  • Data Analysis: The script calculates and visualizes the rise in sea levels over time using linear regression.

Applicability

This code is applicable in scenarios where you need to visualize and analyze sea level rise data to observe trends and patterns. Potential areas of application include:

  • Climate Research: Analyzing historical sea level data to study climate change and its impact.

  • Environmental Monitoring: Visualizing sea level rise for regions vulnerable to coastal flooding.

  • Educational Purposes: Demonstrating the use of linear regression and data visualization in educational contexts.

How to Use

To visualize and analyze sea level rise data using this script, follow these steps:

  1. Clone the repository to your local machine using git clone https://github.com/Mabdullahatif/SeaLevel_Predictor.git.

  2. Download the dataset file epa-sea-level.csv and place it in the repository directory.

  3. Open the Jupyter Notebook or Google Colab environment.

  4. Navigate to the repository directory.

  5. Open the main.py file.

  6. Run the code cells to perform data visualization and analysis and view the generated plot.

Contributing

Contributions are welcome! To contribute to the Sea Level Predictor, follow these steps:

  1. Fork the repository.

  2. Create a new branch for your feature or bug fix.

  3. Make your changes and commit them with descriptive commit messages.

  4. Push your changes to your forked repository.

  5. Create a pull request detailing your changes and explaining their purpose.

Please make sure to follow the repository's code of conduct and guidelines.

Initial Contributor

So far, all the work in this repository is purely done by me.

LinkedIn             Facebook             Instagram             Twitter

                                                                                           

About

Python script that performs data visualization on sea level rise using the Pandas and Matplotlib libraries.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages