In [6]:
import pandas as pd
import numpy as np
import os
import matplotlib.pyplot as plt
%matplotlib inline

In [7]:
# max of each month for each year
def monthMaxDist(file):
    monthHours = [(0, 744), (744, 1416), (1416, 2160), (2160, 2880), (2880, 3624), (3624, 4344), 
                  (4344, 5088), (5088, 5832), (5832, 6552), (6552, 7296), (7296, 8016), (8016, 8760)]
    df = pd.DataFrame()
    df_region = pd.read_csv(file)
    for year in list(df_region.columns):
        listY = list(df_region[year])
        listM = []
        for s, f in monthHours:
            try:
                maxM = max(listY[s:f])
            except:
                maxM = -1
            listM.append(maxM)
        df[year] = listM
    return df.T

In [9]:
allPlots = [(monthMaxDist('load/' + file), file) for file in os.listdir('load') if not file.startswith('.')]

In [10]:
fig, axes = plt.subplots(nrows=8, ncols=1)
for i, (df, t) in enumerate(allPlots):
    df.plot(legend=False, title=t, ax=axes[i], figsize=(15, 60), kind='box')



In [11]:
dfs = [(pd.read_csv('load/' + file), file) for file in os.listdir('load') if not file.startswith('.')]

In [12]:
fig, axes = plt.subplots(nrows=8, ncols=1)
for i, (df, t) in enumerate(dfs):
    df.plot(legend=False, title=t, ax=axes[i], figsize=(15, 60))



In [13]:
dfs = [(pd.read_csv('weather/' + file), file) for file in os.listdir('weather') if not file.startswith('.')]
dfs = [(df.replace([-9999.0, -9999], 'ffill'), t) for df, t in dfs]
fig, axes = plt.subplots(nrows=8, ncols=1)
for i, (df, t) in enumerate(dfs):
    df.plot(legend=False, title=t, ax=axes[i], figsize=(15, 60))


---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-13-b179216639c5> in <module>()
      3 fig, axes = plt.subplots(nrows=8, ncols=1)
      4 for i, (df, t) in enumerate(dfs):
----> 5     df.plot(legend=False, title=t, ax=axes[i], figsize=(15, 60))

/anaconda3/lib/python3.7/site-packages/pandas/plotting/_core.py in __call__(self, x, y, kind, ax, subplots, sharex, sharey, layout, figsize, use_index, title, grid, legend, style, logx, logy, loglog, xticks, yticks, xlim, ylim, rot, fontsize, colormap, table, yerr, xerr, secondary_y, sort_columns, **kwds)
   2939                           fontsize=fontsize, colormap=colormap, table=table,
   2940                           yerr=yerr, xerr=xerr, secondary_y=secondary_y,
-> 2941                           sort_columns=sort_columns, **kwds)
   2942     __call__.__doc__ = plot_frame.__doc__
   2943 

/anaconda3/lib/python3.7/site-packages/pandas/plotting/_core.py in plot_frame(data, x, y, kind, ax, subplots, sharex, sharey, layout, figsize, use_index, title, grid, legend, style, logx, logy, loglog, xticks, yticks, xlim, ylim, rot, fontsize, colormap, table, yerr, xerr, secondary_y, sort_columns, **kwds)
   1975                  yerr=yerr, xerr=xerr,
   1976                  secondary_y=secondary_y, sort_columns=sort_columns,
-> 1977                  **kwds)
   1978 
   1979 

/anaconda3/lib/python3.7/site-packages/pandas/plotting/_core.py in _plot(data, x, y, subplots, ax, kind, **kwds)
   1802         plot_obj = klass(data, subplots=subplots, ax=ax, kind=kind, **kwds)
   1803 
-> 1804     plot_obj.generate()
   1805     plot_obj.draw()
   1806     return plot_obj.result

/anaconda3/lib/python3.7/site-packages/pandas/plotting/_core.py in generate(self)
    256     def generate(self):
    257         self._args_adjust()
--> 258         self._compute_plot_data()
    259         self._setup_subplots()
    260         self._make_plot()

/anaconda3/lib/python3.7/site-packages/pandas/plotting/_core.py in _compute_plot_data(self)
    371         if is_empty:
    372             raise TypeError('Empty {0!r}: no numeric data to '
--> 373                             'plot'.format(numeric_data.__class__.__name__))
    374 
    375         self.data = numeric_data

TypeError: Empty 'DataFrame': no numeric data to plot

In [118]:
for df, i in dfs:
    m = df
    df.sum().plot(xticks=range(18), rot=45, title='Total consumption')


Best options are probably NCENT, EAST


In [ ]: