Skip to content

Instantly share code, notes, and snippets.

@szeitlin
Created October 8, 2014 19:21
Show Gist options
  • Select an option

  • Save szeitlin/1efac3f8ef072663eafb to your computer and use it in GitHub Desktop.

Select an option

Save szeitlin/1efac3f8ef072663eafb to your computer and use it in GitHub Desktop.
drop_max_value from a pandas column
def drop_max_value(df, column):
'''
Re-usable function that finds the max value and drops it.
(df, column) -> df
>>> drop_max_value(df, steep)
df
'''
dropthis = df[column].max()
df = df[df[column] != dropthis]
print "removed that pesky outlier!"
return df
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment