Comments (6)
Even after updating pandas to 1.1.1 , I had the same Type error issue.
After updating the code as @dsevero suggested, It works fine.
Thanks
from icd-prediction-mimic.
Hi, @NarenInD. Thanks for reaching out.
Judging from the error message, it might be an issue with the version of pandas. Would you mind telling us what version you are using? You can check it by running import pandas; print(pandas.__version__)
in the python interpreter.
@arthurreys it might be safer to replace
df.query("HADM_ID.isin(@hadm_ids[0])")
with
df[df['HADM_ID'].isin(hadm_ids[0])]
@NarenInD you can also try the above to see if it helps.
from icd-prediction-mimic.
The pandas version is 0.25.3
Also , I replaced the following line as you suggested, but didn't work. It throws NameError: name 'df' is not defined
self.all_icds_train = utils.make_icds_histogram(self.df.query("HADM_ID.isin(@hadm_ids[0])")).index.tolist()
self.all_icds_train = utils.make_icds_histogram(self.df[df['HADM_ID'].isin(hadm_ids[0])]).index.tolist()
The same mutable issue also gets arised in this line of dataset.py
((self.x_train, self.y_train),
(self.x_val, self.y_val),
(self.x_test, self.y_test)) = [
(self.df.query("HADM_ID.isin(@ids)").TEXT,
self.mlb.transform(self.df.query("HADM_ID.isin(@ids)").ICD9_CODE))
for ids in hadm_ids
]
from icd-prediction-mimic.
@NarenInD, in the first case it should be:
self.df[self.df['HADM_ID'].isin(hadm_ids[0])]
in the second, use this:
((self.x_train, self.y_train),
(self.x_val, self.y_val),
(self.x_test, self.y_test)) = [
(self.df[self.df['HADM_ID'].isin(ids)].TEXT,
self.mlb.transform(self.df[self.df['HADM_ID'].isin(ids)].ICD9_CODE))
for ids in hadm_ids
]
have you tried updating your pandas version with pip or conda?
with pip: pip install --upgrade pip
from icd-prediction-mimic.
Hello @NarenInD!
I've created a new branch issue-5 and added the suggested changes from @dsevero. You can checkout to that branch in order to test the modifications.
As already stated, you could also try updating your current pandas version.
Please let us know if it works for you!
from icd-prediction-mimic.
Good to know! If anything else comes up, let us know :)
from icd-prediction-mimic.
Related Issues (3)
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 icd-prediction-mimic.