0

I am very new to python and I am practicing using data from a CSV file to plot a graph.

The CSV file contains COVID-19 Data, the columns are:
Country, Total Cases, Total Deaths, Population, etc

What I want to do, is select a specific row and pick a specific country to see the total deaths/cases and population.

#IMPORT LIBARIES
import matplotlib.pyplot as plt
import pandas as pd

#IMPORT CSV
data = pd.read_csv('/Users/jess/Desktop/Python and Apps Course/'
                   'PROJECT WORK/COVID-19 Coronavirus.csv', sep=',')
df = pd.DataFrame(data, columns=['Country', 'Continent', 'Population', 'Total Cases',
                  'Total Deaths', 'Death Percentage'])

#GRAPH
plt.figure(figsize=(10,4))
plt.plot(df['Total Cases'], label='Total Cases')
plt.plot(df['Total Deaths'], label='Total Deaths')
plt.plot(df['Population'], label='Population Rolling')
plt.xlabel('Country')
plt.ylabel('Covid Trends')
plt.legend()

#RUN GRAPH
plt.show()
martineau
  • 112,593
  • 23
  • 157
  • 280
jrw97
  • 1

0 Answers0