Skip to content

Instantly share code, notes, and snippets.

@jccorrea
Created June 23, 2017 02:15
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 jccorrea/09ac63f16c4be08544dbcca11b6aae13 to your computer and use it in GitHub Desktop.
Save jccorrea/09ac63f16c4be08544dbcca11b6aae13 to your computer and use it in GitHub Desktop.
pandas - drop + rename column
print(df.head())
#print(df.drop(df[df['Quantity'] == 0].index))
print((df.drop(df[df['Quantity']== 0].index)
.rename(columns={'Weight':'Weight(oz.)'})
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment