-
Notifications
You must be signed in to change notification settings - Fork 6
Avoid using iterrows, use vectorization wherever possible #120
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
base: dev
Are you sure you want to change the base?
Conversation
for index, row in data_frame.iterrows(): | ||
for row in data_frame.itertuples(index=False): | ||
train_data.append( | ||
[ | ||
data_frame.iloc[index].values[1], | ||
data_frame.iloc[index].values[2:502].tolist(), | ||
row.SMILES, | ||
row.LABELS, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about this lines of code, whether this was the actual change intended
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for implementing this. I created a new dataset with these changes and it worked (although there was no major performance boost, because the most time-intensive part is the split generation).
ok, I have few minor changes which I will commit later. Will mark the PR ready for review once done. |
5ca7b14
to
13afc28
Compare
df.iterrows()
withdf.itertuples()
for Significant Performance Gains #86