import pandas as pd
import matplotlib.pyplot as plt
df = pd.read_csv('/work/covid_oceania_weekly_trend.csv')
df
df.columns
#Ordenar
df_cases = df.sort_values('Cases in the last 7 days', ascending=False)
#Graficar
plt.bar(df_cases['Country/Other'], df_cases['Cases in the last 7 days'])
plt.grid()
plt.title('Countries with more cases in the last 7 days of Covid.19')
plt.xlabel('Country')
plt.ylabel('Cases in last 7 days')
plt.xticks(rotation=-270)
plt.show()
#Ordenar
df_deaths = df.sort_values('Deaths in the last 7 days', ascending=False)
#Graficar
plt.figure(figsize=(6,4))
plt.bar(df_deaths['Country/Other'], df_deaths['Deaths in the last 7 days'])
plt.title('Deaths')
plt.xlabel('Country')
plt.ylabel('Deaths')
plt.xticks(rotation=45)
plt.grid()
plt.show()
plt.hist(df['Cases in the last 7 days'])
plt.grid()
plt.title('Cases of Covid-19')
plt.xlabel('Numéro de casos')
plt.ylabel('numero del número de casos')
plt.show()
bins = [i for i in range(0, 1200, 200)]
bins = list(range(0, 30000, 5000))
plt.hist(df['Cases in the last 7 days'], bins )
plt.grid()
plt.title('Cases of Covid-19')
plt.xlabel('Numéro de casos')
plt.ylabel('numero del número de casos')
plt.show()
bins = [i for i in range(0, 1200, 200)]
bins = list(range(0, 6000, 1000))
plt.hist(df['Cases in the last 7 days'], bins )
plt.grid()
plt.title('Cases of Covid-19')
plt.xlabel('Numéro de casos')
plt.ylabel('numero del número de casos')
plt.show()
#Ordernar
df_reduction = df.sort_values('Weekly Case % Change', ascending=True)
#Graficar
plt.figure(figsize=(8,6))
plt.bar(df_reduction['Country/Other'], df_reduction['Weekly Case % Change'])
plt.title('Reduction of cases')
plt.xlabel('Countries')
plt.ylabel('Percent')
plt.xticks(fontsize=13, rotation=90)
plt.grid()
plt.show()
#Ordenar
df_min_death = df.sort_values('Weekly Death % Change', ascending=True)
#GRaficar
plt.figure(figsize=(8,6))
plt.bar(df_min_death['Country/Other'], df_min_death['Weekly Death % Change'])
plt.title('Reduction of Deaths')
plt.xlabel('Countries')
plt.ylabel('Deaths')
plt.grid()
plt.xticks(fontsize=15, rotation=35)
plt.show()
plt.scatter(df_cases['Cases in the last 7 days'][-9:], df_cases['Deaths in the last 7 days'][-9:])
plt.xlabel('Cases')
plt.ylabel('Deaths')
plt.show()
plt.scatter(df['Cases in the preceding 7 days'], df_cases['Cases in the last 7 days'])
plt.ylabel('Semana')
plt.xlabel('Seamana Anterior')
plt.show()
plt.scatter(df_cases['Cases in the preceding 7 days'][-5:], df_cases['Cases in the last 7 days'][-5:])
plt.ylabel('Semana')
plt.xlabel('Seamana Anterior')
plt.show()
plt.scatter(df['Population'], df['Cases in the last 7 days'])
plt.xlabel('Population')
plt.ylabel('Cases')
plt.show()
plt.scatter(df['Population'], df['Deaths in the last 7 days'])
plt.xlabel('Population')
plt.ylabel('Deaths')
plt.show()
plt.scatter(df['Deaths in the preceding 7 days'], df['Deaths in the last 7 days'])
plt.xlabel('semana pasada')
plt.ylabel('semana')
plt.show()