Skip to content

Instantly share code, notes, and snippets.

@westonplatter
Last active February 19, 2020 19:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save westonplatter/7511cd7c2d42da21615851bd45bb54d4 to your computer and use it in GitHub Desktop.
Save westonplatter/7511cd7c2d42da21615851bd45bb54d4 to your computer and use it in GitHub Desktop.
# Pandas operations
## getting and setting df rows
credit goes to https://stackoverflow.com/a/29262040/665578
for i, row in df.iterrows():
ifor_val = something
if <condition>:
ifor_val = something_else
df.at[i,'ifor'] = ifor_val
## setting number of displayed columns
code,
pd.options.display.max_colwidth = 60
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment