Skip to content

Instantly share code, notes, and snippets.

@filipwodnicki
Created November 4, 2019 10:03
Show Gist options
  • Save filipwodnicki/c14ad3c45ce9aa0fa054c84ff1adec57 to your computer and use it in GitHub Desktop.
Save filipwodnicki/c14ad3c45ce9aa0fa054c84ff1adec57 to your computer and use it in GitHub Desktop.
Pandas cheatsheet
# 1. Apply works with multiple arguments
## instead of this
binary_test["prediction"] = binary_test["sentence"].apply(lambda x: get_prediction(x, PROJECT_ID, BINARY_MODEL_ID))
## do this
binary_test["prediction"] = binary_test["sentence"].apply(get_predictions, project_id=PROJECT_ID, model_id=BINARY_MODEL_ID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment