Skip to content

Instantly share code, notes, and snippets.

@j-bennet
Last active November 25, 2019 04:14
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 j-bennet/a9a4971c7d48ee81341be4981e826504 to your computer and use it in GitHub Desktop.
Save j-bennet/a9a4971c7d48ee81341be4981e826504 to your computer and use it in GitHub Desktop.
In [64]: def convert_int_types(df_iter):
...: for chunk in df_iter:
...: chunk["payment_id"] = chunk["payment_id"].astype(np.uint16)
...: chunk["customer_id"] = chunk["customer_id"].astype(np.uint16)
...: chunk["staff_id"] = chunk["staff_id"].astype(np.uint8)
...: yield chunk
...:
...:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment