In [1]:
import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
plt.style.use('ggplot')
get_ipython().magic('pylab inline')


Populating the interactive namespace from numpy and matplotlib

In [2]:
# Cartelle Input/Output
dir_df = os.path.join(os.path.abspath(''),'stg')
dir_out = os.path.join(os.path.abspath(''),'output')

In [3]:
df_g8_filename = r'df_g8.pkl'
df_g8_fullpath = os.path.join(dir_df, df_g8_filename)
df_g8 = pd.read_pickle(df_g8_fullpath)

In [4]:
df_g8.head(5)


Out[4]:
Nord Sud
Anno
1977 5.76 8.05
1978 6.09 7.98
1979 6.14 8.60
1980 6.15 8.89
1981 6.76 9.44

In [5]:
tp = df_g8.plot(kind='line',
               legend = True)
tp.set_xlabel("")
tp.set_ylabel("Tasso di disoccupazione")
plt.xticks(rotation=45)
fig_posts = tp.get_figure()
fig_posts.tight_layout()
fig_posts.savefig(os.path.join(dir_out,'G8_Disoccupazione.png'), format='png', dpi=1000)