In [50]:
%matplotlib inline
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import seaborn as sns
In [6]:
fn2009 = 'rpt.00013424.0000000000000000.20141016.182537070.ERCOT_2009_Hourly_Wind_Output.xls'
fn2015 = 'rpt.00013424.0000000000000000.ERCOT_2015_Hourly_Wind_Output.xlsx'
df_2009 = pd.read_excel(fn2009, index_col=0, sn='2009')
df_2015 = pd.read_excel(fn2015, index_col=0, sn='2015')
In [8]:
df_2009.head()
Out[8]:
In [24]:
df_2009['hour'] = df_2009.index.hour
df_2009['year'] = df_2009.index.year
In [15]:
df_2015.head()
Out[15]:
In [25]:
df_2015['hour'] = df_2015.index.hour
df_2015['year'] = df_2015.index.year
In [ ]:
df =
In [17]:
sns.factorplot('hour', '% Installed Wind Capacity', data=df_2009, aspect=1.5)
plt.title('2009 Wind Capacity by Hour of Day')
Out[17]:
In [19]:
sns.factorplot('hour', 'Wind Output, % of Installed', data=df_2015, aspect=1.5)
plt.title('2015 Wind Capacity by Hour of Day')
Out[19]:
In [22]:
sns.factorplot('hour', 'Wind % of ERCOT Load', data=df_2009, aspect=1.5)
plt.title('2009 Wind as fraction of total load')
Out[22]:
In [21]:
sns.factorplot('hour', 'Wind Output, % of Load', data=df_2015, aspect=1.5)
plt.title('2015 Wind as fraction of total load')
Out[21]:
In [1]:
import glob
In [38]:
files = glob.glob('*.xls')
files.extend(glob.glob('*.xlsx'))
# df = pd.DataFrame()
# for fn in files:
# temp_df = pd.read_excel(fn, sn='numbers', index_col=0)
# if temp_df.index.values[0] != pd.Timestamp:
# print fn
# try:
# df = pd.concat[]
df = pd.concat([pd.read_excel(fn, sn='numbers', index_col=0) for fn in files])
In [52]:
df.sort_index(inplace=True)
In [53]:
df.head()
Out[53]:
In [54]:
df.tail()
Out[54]:
In [55]:
df = df.iloc[:-1,:]
In [56]:
df.tail()
Out[56]:
In [15]:
cols = df_2009.columns[:-2]
cols
Out[15]:
In [57]:
df_final = df.loc[:,cols]
df_final.head()
Out[57]:
In [58]:
df_final.dtypes
Out[58]:
In [59]:
df_final.plot(y='Total Wind Installed, MW', use_index=True)
Out[59]:
In [80]:
sns.jointplot('ERCOT Load, MW', 'Total Wind Output, MW', data=df_final, kind='hex')
Out[80]:
In [60]:
import os
In [77]:
filename = 'ERCOT wind data.csv'
path = '../../../Clean Data'
fullpath = os.path.join(path, filename)
In [79]:
df_final.to_csv(fullpath)
In [ ]: