Created
October 8, 2014 19:21
-
-
Save szeitlin/1efac3f8ef072663eafb to your computer and use it in GitHub Desktop.
drop_max_value from a pandas column
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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