Python -import pandas as pd

import pandas as pd
import numpy as np
%matplotlib inline

pd.core.common.is_list_like=pd.api.types.is_list_like

import pandas_datareader as web
import datetime
start=datetime.datetime(2000,1,1)
end=datetime.datetime(2018,8,30)
gdp=web.DataReader(‘A191RL1Q225SBEA’, ‘fred’, start, end)
inflation = web.DataReader([‘CPIAUCSL’, ‘CPILFESL’], ‘fred’, start, end)

In [148]:

df =inflation[“CPIAUCSL”].pct_change(periods=12)*100

df.plot.line()

Out[148]:

In [134]:

df.plot.hist(alpha=0.5)

Out[134]:

In [136]:

df.plot.box()

Out[136]:

In [140]:

df=df.cumsum()
df.plot()

Out[140]:

In [64]:

import matplotlib.pyplot as plt
import seaborn as sns
import plotly.plotly as py

Pct_Annual=inflation[“CPIAUCSL”].pct_change(periods=12)*100

y=Pct_Annual
N=len(y)
x=range(N)
width=1/1.5
plt.bar(x,y, width, color=”blue”)

Out[64]:

In [150]:

gdp.plot()
df.plot(secondary_y=True, style=’g’)

Out[150]:

In [159]:

plt.figure()
df.plot()

Out[159]:

In [57]:

import pandas as pd
import numpy as np
%matplotlib inline

pd.core.common.is_list_like=pd.api.types.is_list_like

import pandas_datareader as web
import datetime
start=datetime.datetime(2000,1,1)
end=datetime.datetime(2018,8,30)
gdp=web.DataReader(‘A191RL1Q225SBEA’, ‘fred’, start, end)
inflation = web.DataReader([‘CPIAUCSL’, ‘CPILFESL’], ‘fred’, start, end)

gdp.head()
gdp.tail()
inflation.plot()
gdp.plot()

Out[57]:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s