Comments (5)
OK, we managed to find what the problem was. I am running a newer version of python and pandas and one of them (probably pandas) has a problem with this part of the code:
def fixNansInX(x):
'''
Takes in x DataFrame, edits it so that important keys
are 0 instead of NaN.
'''
keyCheckNullList = ["Short Term Debt" ,\
"Long Term Debt" ,\
"Interest Expense, Net",\
"Income Tax (Expense) Benefit, Net",\
"Cash, Cash Equivalents & Short Term Investments",\
"Property, Plant & Equipment, Net",\
"Revenue",\
"Gross Profit",\
"Total Current Liabilities",\
"Property, Plant & Equipment, Net"]
x[keyCheckNullList]=x[keyCheckNullList].fillna(0)
The problem is that "Property, Plant & Equipment, Net" appears twice in this list which causes the fixNansInX(x) function to crash. The solution is simple, just delete the last item in the keyCheckNullList and that is it.
And now everything works for me.
from build_your_own_ai_investor_2021.
Can you try running in this order?
fixNansInX(x_)
addColsToX(x_)
X=getXRatios(x_)
fixXRatios(X)
from build_your_own_ai_investor_2021.
Tried it, didn't help, same error. It seems as if the pandas library changed how fillna(0) works or something, I can't figure it out.
I extracted the code from the function fixNansInX(x)
and tried running it step by step. Applying boolean masks works but when I need to replace the data it doesn't work and the error description doesn't make sense.
from build_your_own_ai_investor_2021.
Strange, it works for me. Email me on the protonmail address I'll give you a sample of the data that worked.
from build_your_own_ai_investor_2021.
ai_investor(at)protonmail.com
from build_your_own_ai_investor_2021.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from build_your_own_ai_investor_2021.