-
Notifications
You must be signed in to change notification settings - Fork 0
/
DataVisualization.py
40 lines (31 loc) · 1.03 KB
/
DataVisualization.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Author: Ioannis Matzakos | Date: 01/05/2020
# import python modules needed
import pandas as pd
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import statsmodels.api as sm
import itertools
import warnings
from pylab import rcParams
# import project's classes and scripts
from Utilities import Log
# Configure logger
log = Log.setup_logger("data_visualization")
# Configure pyplot
plt.style.use('fivethirtyeight')
warnings.filterwarnings("ignore")
# Configure matplotlib
matplotlib.rcParams['axes.labelsize'] = 14
matplotlib.rcParams['xtick.labelsize'] = 12
matplotlib.rcParams['ytick.labelsize'] = 12
matplotlib.rcParams['text.color'] = 'k'
class DataVisualization:
def plot_data_structure(self, dataframe):
dataframe.plot(figsize=(15, 6))
plt.show()
def get_decomposition_plot(self, x):
rcParams['figure.figsize'] = 18, 8
decomposition = sm.tsa.seasonal_decompose(x, model='additive')
fig = decomposition.plot()
plt.show()