<class 'pandas.core.frame.DataFrame'>
Int64Index: 992 entries, 169975 to 170966
Data columns (total 7 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 new_tests_smoothed 816 non-null float64
1 new_deaths_smoothed 968 non-null float64
2 hosp_patients_per_million 774 non-null float64
3 human_development_index 992 non-null float64
4 weekly_icu_admissions_per_million 0 non-null float64
5 tests_units 823 non-null object
6 date 992 non-null object
dtypes: float64(5), object(2)
memory usage: 62.0+ KB
round(df1.describe(), 4)
new_tests_smoothedfloat64
new_deaths_smoothedfloat64
count
816.0
968.0
mean
52293.538
26.1641
std
56098.1322
42.9506
min
67.0
0.429
25%
20088.75
5.9642
50%
39309.5
12.143
75%
55146.5
26.857
max
300415.0
290.857
df1.isna().sum()
df2=df1.dropna(axis=1, how='all').fillna(df1.mean(numeric_only=True))
round(df2.describe(), 3)
new_tests_smoothedfloat64
new_deaths_smoothedfloat64
count
992.0
992.0
mean
52293.538
26.164
std
50873.355
42.427
min
67.0
0.429
25%
26734.0
6.0
50%
45983.5
12.429
75%
52293.538
26.164
max
300415.0
290.857
sns.set_style("darkgrid")
fig, ax1 = plt.subplots()
color = 'tab:red'
ax1.set_xlabel('date')
ax1.set_ylabel('new tests smoothed', color=color)
ax1.tick_params(axis='x', rotation=55)
ax1.plot(t, data1, color=color)
ax1.tick_params(axis='y', labelcolor=color)
plt.text((650)*1.1, (300000)*0.95, 'Punto maximo', fontsize=10, color='Black')
plt.title('new deaths smoothed \n and new tests smoothed')
ax2 = ax1.twinx()
color = 'tab:blue'
ax2.set_ylabel('new deaths smoothed', color=color)
ax2.plot(t, data2, color=color)
ax2.tick_params(axis='y', labelcolor=color)
fig.tight_layout()
plt.xticks(range(1,992,40))
plt.xlim(600,1000)
ax1.plot(data1, label = "new tests smoothed")
ax1.plot(data2, label = "new deaths smoothed")
ax1.legend(["new tests smoothed","new deaths smoothed"])
plt.text((900), 20, 'Descenso', fontsize=10, color='Black')
plt.show()
sns.set_style("darkgrid")
fig, ax1 = plt.subplots()
color = 'tab:red'
ax1.set_xlabel('date')
ax1.set_ylabel('new tests smoothed', color=color)
ax1.tick_params(axis='x', rotation=55)
ax1.plot(t, data1, color=color)
ax1.tick_params(axis='y', labelcolor=color)
plt.title('new tests smoothed \n and tests used')
ax2 = ax1.twinx()
color = 'tab:blue'
ax2.set_ylabel('tests used', color=color)
ax2.plot(t, df3, color=color)
ax2.tick_params(axis='y', labelcolor=color)
fig.tight_layout()
plt.xticks(range(1,992,40))
plt.xlim(600,1000)
ax1.plot(data1, label = "new tests smoothed")
ax1.plot(df3, label = "tests used")
ax1.legend(["new tests smoothed","tests used"])
plt.show()
plt.hist(data3, orientation='horizontal', bins=30)
plt.xlabel('Frecuencia')
plt.ylabel('hosp patients per million')
plt.hist(data2, orientation='horizontal', bins=30)
plt.xlabel('Frecuencia')
plt.ylabel('new deaths smoothed')