This project was inspired by Alex The Analyst and his Covid Analysis. The goal of this project is to demonstrate how to connect a PostgreSQL database to Python and run queries through it, using the Python libraries Pandas and Psycopg2. The project also includes a Jupyter notebook that shows a step-by-step process for extracting and analyzing historical data of COVID-19 up to January 8, 2022.
- Data Preparation: We first used Microsoft Excel to format and modify a .csv file downloaded from Our World In Data into two separate files ("CovidDeaths.csv" and "CovidVaccinations.csv"), which were then uploaded to a local PostgreSQL database.
- Connect to Database: Next, we used the Python library Psycopg2 to connect to the PostgreSQL database and run SQL queries to extract the data we needed.
- Create Views: We also saved some of the queries as views, which were not used in this project, but can be helpful for other projects.
- Data Analysis: Finally, we used the Pandas library to display the results of the queries, perform further analysis and manipulate the data for better understanding.
The main goal of this project is to extract insights and deliver a interactive visualization to showcase the analysis on historical data of COVID-19, up to the date Jan 8, 2022. The project also demonstrates how to integrate Postgres SQL with Python to run queries, and use libraries like Pandas for analysis and data manipulation
This project serves as a useful resource for anyone looking to connect a PostgreSQL database to Python and run queries through it, as well as for those looking to use Pandas for data analysis and manipulation.
You can find the code for this project on HERE