Skip to content

Instantly share code, notes, and snippets.

@tillahoffmann
Last active June 24, 2023 07:39
Show Gist options
  • Star 18 You must be signed in to star a gist
  • Fork 9 You must be signed in to fork a gist
  • Save tillahoffmann/f844bce2ec264c1c8cb5 to your computer and use it in GitHub Desktop.
Save tillahoffmann/f844bce2ec264c1c8cb5 to your computer and use it in GitHub Desktop.
Weighted kernel density estimation based on `scipy.stats.gaussian_kde`.
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@andrewfowlie
Copy link

Very useful code. I think a

from scipy.lib.six import string_types

may be missing. Without it, setting the bw_method to a scalar (e.g. 0.1 and not scott) results in an exception.

@ColinTalbert
Copy link

My hat off to you sir. Thank you for sharing this. Extremely helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment