Skip to content

Commit bdd4ba3

Browse files
committed
WIP Grapsh with diffs in EPS between my own calculated ones and the ones coming from the fundamentals CSV files
1 parent 7c60abe commit bdd4ba3

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

040_ticker_plots

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def get_plt(dicts, ticker):
113113
plt.subplots_adjust(left=.16,right=.96,top=.94,bottom=.16,hspace=0)
114114

115115
ticker_fig = plt.gcf() # for "get current figure"
116-
ticker_fig.savefig('./graphs/'+ticker+'.png', dpi=300, format='png')
116+
ticker_fig.savefig(conf_info.graphs_dir + conf_info.get_tickers_plot_filename(ticker), dpi=300, format='png')
117117
return plt
118118

119119

999_checks

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ import pandas as pd
44
import matplotlib.pyplot as plt
55
import matplotlib.ticker as mticker
66

7+
import modules.config_details as conf_info
8+
79
dates_formatter = '%Y-%m-%d'
810
dateparse = lambda x: pd.datetime.strptime(x, dates_formatter)
911

1012
def 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

1517
def 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

graphs/checks_eps.png

36.1 KB
Loading

modules/config_details.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,9 @@ def get_peg_filename(ticker):
3838
pe_median_filename_prefix = 'pe_median_'
3939
peg_filename_prefix = 'peg_'
4040

41+
# GRAPHS
42+
43+
graphs_dir = './graphs/'
44+
def get_tickers_plot_filename(ticker):
45+
return ticker.upper() + '.png'
46+

0 commit comments

Comments
 (0)