Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem to run the Automated Fundamental Analysis #1

Open
ejlamarque opened this issue Feb 4, 2022 · 1 comment
Open

Problem to run the Automated Fundamental Analysis #1

ejlamarque opened this issue Feb 4, 2022 · 1 comment

Comments

@ejlamarque
Copy link

ejlamarque commented Feb 4, 2022

Hi.
First of all, congratulation on the amazing job here.
I download the repository through the git command a couple of months ago and work properly without any trouble. Now I would like to run again the analysis after quarterly results, but it is not working anymore for some reason. There is something that could change maybe? I am not an expert, to be honest, but if one time run, I don't understand why the second not. I clone everything again but still not working. Could be related to the getsectordata.py file because is writing the sectors but left them empty.
Please find below the code in order to see if there is any clue of what could be wrong. Thank you in advance

C:\Users\ejlam\Documents\Automated-Fundamental-Analysis>py getsectordata.py

Gathering data from basicmaterials sector...
Saved: SectorData\SectorData - basicmaterials.csv

Gathering data from communicationservices sector...
Saved: SectorData\SectorData - communicationservices.csv

Gathering data from consumercyclical sector...
Saved: SectorData\SectorData - consumercyclical.csv

Gathering data from consumerdefensive sector...
Saved: SectorData\SectorData - consumerdefensive.csv

Gathering data from energy sector...
Saved: SectorData\SectorData - energy.csv

Gathering data from financial sector...
Saved: SectorData\SectorData - financial.csv

Gathering data from healthcare sector...
Saved: SectorData\SectorData - healthcare.csv

Gathering data from industrials sector...
Saved: SectorData\SectorData - industrials.csv

Gathering data from realestate sector...
Saved: SectorData\SectorData - realestate.csv

Gathering data from technology sector...
Saved: SectorData\SectorData - technology.csv

Gathering data from utilities sector...
Saved: SectorData\SectorData - utilities.csv
Saved: SectorData\SectorData - AllSectors.csv
C:\Users\ejlam\AppData\Local\Programs\Python\Python37\lib\site-packages\numpy\core\fromnumeric.py:3335: RuntimeWarning: Mean of empty slice.
out=out, **kwargs)
C:\Users\ejlam\AppData\Local\Programs\Python\Python37\lib\site-packages\numpy\core_methods.py:161: RuntimeWarning: invalid value encountered in double_scalars
ret = ret.dtype.type(ret / rcount)
C:\Users\ejlam\AppData\Local\Programs\Python\Python37\lib\site-packages\numpy\core_methods.py:217: RuntimeWarning: Degrees of freedom <= 0 for slice
keepdims=keepdims)
C:\Users\ejlam\AppData\Local\Programs\Python\Python37\lib\site-packages\numpy\core_methods.py:186: RuntimeWarning: invalid value encountered in true_divide
arrmean, rcount, out=arrmean, casting='unsafe', subok=False)
C:\Users\ejlam\AppData\Local\Programs\Python\Python37\lib\site-packages\numpy\core_methods.py:209: RuntimeWarning: invalid value encountered in double_scalars
ret = ret.dtype.type(ret / rcount)
Traceback (most recent call last):
File "getsectordata.py", line 283, in
smoothAvg, start, change = getAverage(sector, metric, lessThan)
File "getsectordata.py", line 237, in getAverage
metricAvg = avg / validCells
ZeroDivisionError: division by zero

C:\Users\ejlam\Documents\Automated-Fundamental-Analysis>py stockratings.py
Which set of stocks do you want to get the ratings for?
Enter 1 for S&P500 stocks
Enter 2 for Mid Cap stocks over $2B Market Cap
Enter 3 for stocks over $300 Mln Market Cap
Enter 4 for stocks under $2B Market Cap
1

Loading data from SymbolData\S&P500Symbols.csv
0%| | 0/505 [00:00<?, ?it/s]C:\Users\ejlam\AppData\Local\Programs\Python\Python37\lib\site-packages\numpy\core\fromnumeric.py:3335: RuntimeWarning: Mean of empty slice.
out=out, **kwargs)
C:\Users\ejlam\AppData\Local\Programs\Python\Python37\lib\site-packages\numpy\core_methods.py:161: RuntimeWarning: invalid value encountered in double_scalars
ret = ret.dtype.type(ret / rcount)
C:\Users\ejlam\AppData\Local\Programs\Python\Python37\lib\site-packages\numpy\core_methods.py:217: RuntimeWarning: Degrees of freedom <= 0 for slice
keepdims=keepdims)
C:\Users\ejlam\AppData\Local\Programs\Python\Python37\lib\site-packages\numpy\core_methods.py:186: RuntimeWarning: invalid value encountered in true_divide
arrmean, rcount, out=arrmean, casting='unsafe', subok=False)
C:\Users\ejlam\AppData\Local\Programs\Python\Python37\lib\site-packages\numpy\core_methods.py:209: RuntimeWarning: invalid value encountered in double_scalars
ret = ret.dtype.type(ret / rcount)
0%| | 0/505 [00:01<?, ?it/s]
Traceback (most recent call last):
File "stockratings.py", line 875, in
getStockStats()
File "stockratings.py", line 853, in getStockStats
getStockData(stock)
File "stockratings.py", line 574, in getStockData
valuationGrade = getCategoryGrade(sector.lower(), valuationStats)
File "stockratings.py", line 467, in getCategoryGrade
output.append(getGrade(arr[x][0], arr[x][1], sector))
File "stockratings.py", line 269, in getGrade
start, change = getSectorStats(sector, mtrc, lessThan)
File "stockratings.py", line 176, in getSectorStats
metricAvg = avg / validCells
ZeroDivisionError: division by zero

C:\Users\ejlam\Documents\Automated-Fundamental-Analysis>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@ejlamarque and others