Density 
A simple dict specification of an algebra of continuous univariate density function mixtures using pydantic.
Install
pip install density
Specifying densities or mixtures of the same
See examples of specifying densities.
See the Scipy manifest for a list of densities.
Evaluating densities
The current use case involves evaluation of a single data point at a time. For this we recommend using the builtin option rather than scipy, and using https://github.com/microprediction/densitypdf package.
from densitypdf import density_pdf
mixture_spec = {
"type": "mixture",
"components": [
{
"density": {
"type": "scipy",
"name": "norm",
"params": {"loc": 0, "scale": 1}
},
"weight": 0.6
},
{
"density": {
"type": "builtin",
"name": "norm",
"params": {"loc": 2.0, "scale": 1.0}
},
"weight": 0.4
}
]
}
val = density_pdf(mixture_spec, x=0.0)
You can also evaluate manually of course, per examples here.
Metadata
Release files for density 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| density-1.0.1.tar.gz | 6.2 kB | Without provenance | Details for density-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| density-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for density-1.0.1-py3-none-any.whl |
Total release size: 10.0 kB
Release files / density-1.0.1.tar.gz
| Download URL | density-1.0.1.tar.gz |
|---|---|
| Size | 6.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8af7e704cb3c156804c3f305d06e4b971665e4d1b5605185bdcf2b34f3afe440
|
|
BLAKE2b-256 checksum How to use checksums |
502e22eb0d99d2990a1071f9365e766983fb59041e46282318530ec506c20e63
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Release files / density-1.0.1-py3-none-any.whl
| Download URL | density-1.0.1-py3-none-any.whl |
|---|---|
| Size | 3.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
efea218aca97a011595aa4647cd947f9cfae27916a8b28ba3c3f67b0053967e2
|
|
BLAKE2b-256 checksum How to use checksums |
c0299377573c3593a021e595a7a382390fa4ead16eccb611fef0f9e10b0bbfa6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Security for density 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.