Skip to content

Instantly share code, notes, and snippets.

@h3ik0th
Created October 6, 2022 15:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save h3ik0th/a39b34b662fddeaa46b9f77a7bea9859 to your computer and use it in GitHub Desktop.
Save h3ik0th/a39b34b662fddeaa46b9f77a7bea9859 to your computer and use it in GitHub Desktop.
%%time
# conventional loop using iloc - iteration crime
dfY = pd.DataFrame()
for i in range(dfS.shape[0]):
res = myfunc1(dfS["B"].iloc[i], dfS["C"].iloc[i])
dfY = pd.concat([dfY, pd.DataFrame([res])], ignore_index=True)
dfY.rename(columns={0:"x", 1:"y", 2:"z"}, inplace=True)
display(dfY.tail())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment