Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # coding: utf-8
- # In[1]:
- from scipy.stats import sem
- import pandas as pd
- import matplotlib.pyplot as plt
- get_ipython().run_line_magic('matplotlib', 'inline')
- # In[2]:
- df = pd.read_csv("remittance-inflow.csv")
- # In[3]:
- df.head()
- # In[4]:
- india_data = df[df["Migrant remittance inflows (US$ million)"] == 'India']
- # In[5]:
- india_data = india_data.fillna(1)
- # In[6]:
- india_data["1970"]
- # In[7]:
- india_data.loc[:"1970"]
- # In[8]:
- col_list = india_data.columns[2:]
- # In[9]:
- india_data[col_list].iloc[0]
- # In[10]:
- india_data_s = india_data[col_list].iloc[0]
- # In[99]:
- x = india_data_s.index
- x = x[:47]
- x
- # In[101]:
- y = india_data_s.values
- y = y[:47]
- # In[102]:
- x=x.astype('float64',copy=False)
- y=y.astype('float64',copy=False)
- # In[103]:
- plt.plot(x,y)
- # In[104]:
- x
- # In[105]:
- india_data_s.rolling(window=5).mean()[:47].index
- x= india_data_s.rolling(window=2).mean()[:47].index
- y= india_data_s.rolling(window=2).mean()[:47].values
- # In[107]:
- fig = plt.figure(figsize=(14,8))
- ax = plt.subplot(111)
- plt.plot(x,y)
- plt.xlim(1970,2016)
- plt.ylim(0,75000)
- t = plt.xticks(x,x,rotation='vertical',fontsize=12)
- plt.fill_between(x,y+5000,y-5000,color='#3F5D7D')
- plt.plot(x,y,color='white',lw=2)
- # In[108]:
- import plotly as pltly
- # In[109]:
- pltly.tools.set_credentials_file(username='zero_0',api_key='iTLrjreGKQBYDFnTpQgz')
- # In[110]:
- import plotly.tools as tls
- # In[111]:
- pltly_fig = tls.mpl_to_plotly(fig)
Add Comment
Please, Sign In to add comment