List of tutorials, etc...:
In [1]:
import fred
import numpy as np
import pandas as pd
In [2]:
api_key = 'insert your key here'
fred.key(api_key)
Out[2]:
In [3]:
#fred.search("Income")
In [4]:
gdp = fred.observations("GDP")
#gdp
In [5]:
#put the data in a dataframe
data = pd.DataFrame(gdp['observations'])
#data
In [ ]:
# fix missing
data['value'] = data['value'].replace('.', np.NaN)
data = data.dropna()
data['value'] = data['value'].astype(float)
# dates
dates = pd.Series(pd.to_datetime(data['date']))
# plotting
import matplotlib.pyplot as plt
plt.plot_date(dates, data['value'])
plt.show()
In [1]:
import matplotlib.pyplot as plt
plt.clf()
x = np.arange(0,5,0.1)
y = np.sin(x)
plt.plot(x,y)
plt.show()