@@ -4,12 +4,14 @@ import pandas as pd
44import matplotlib .pyplot as plt
55import matplotlib .ticker as mticker
66
7+ import modules .config_details as conf_info
8+
79dates_formatter = '%Y-%m-%d'
810dateparse = lambda x : pd .datetime .strptime (x , dates_formatter )
911
1012def get_series_func (ticker ):
11- eps_calculated_df = pd .read_csv ('./data/calculated_ratios/eps_' + ticker + '.csv' , parse_dates = ['Date' ], date_parser = dateparse )
12- eps_from_fundamentals_df = pd .read_csv ('./data/fundamentals/fundamentals_' + ticker + '.csv' , parse_dates = ['end_date' ], date_parser = dateparse )[['end_date' ,'eps_basic' ]]
13+ eps_calculated_df = pd .read_csv (conf_info . ratios_dir + conf_info . get_eps_filename ( ticker ) , parse_dates = ['Date' ], date_parser = dateparse )
14+ eps_from_fundamentals_df = pd .read_csv (conf_info . fundamentals_dir + conf_info . get_fundamentals_filename ( ticker ) , parse_dates = ['end_date' ], date_parser = dateparse )[['end_date' ,'eps_basic' ]]
1315 return eps_calculated_df , eps_from_fundamentals_df
1416
1517def plot_axis_with_data (axis , calc_df , fund_df ):
@@ -45,10 +47,10 @@ def build_plot(tickers, series_func):
4547 # store the plots
4648 plt .subplots_adjust (left = .08 ,right = .88 ,hspace = 0 )
4749 ticker_fig = plt .gcf () # for "get current figure"
48- ticker_fig .savefig ('./graphs/ checks_eps.png' , dpi = 300 , format = 'png' )
50+ ticker_fig .savefig (conf_info . graphs_dir + ' checks_eps.png' , dpi = 300 , format = 'png' )
4951 plt .show ()
5052
5153
52- build_plot (['AAPL' ,'AMZN' ,'EBAY' ,'GOOG' ,'NFLX' ,'TSLA' ],get_series_func )
54+ build_plot (['AAPL' ,'AMZN' ,'EBAY' ,'GOOG' ,'NFLX' ,'TSLA' , 'G' ],get_series_func )
5355
5456
0 commit comments