Created
November 13, 2018 16:30
-
-
Save MilesCranmer/f67c8feffb20e6b6c0e713e4127e1cbf to your computer and use it in GitHub Desktop.
Plot only 99th percentile of data with pandas.
This file contains 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 plotdf(df, x, y, sample=10000): | |
df = df[[x, y]].sample(sample).copy() | |
for col in [x, y]: | |
df = df[(df[col] > df[col].quantile(0.01)) & (df[col] < df[col].quantile(0.99))] | |
df.plot( | |
x, y, | |
linestyle='', marker='.', | |
markersize=0.1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment