DDSketch is a Python library for distributed quantile sketches, an algorithm for estimating quantiles with guaranteed relative accuracy. It allows for merging sketches from different sources while maintaining accuracy. The current version is 3.0.1. Releases are made as needed for bug fixes, Python version compatibility, or feature enhancements.
pip install ddsketchVerified import paths — ran on the pinned version, not inferred.
This example demonstrates initializing a DDSketch, adding data points, retrieving quantiles, and merging with another sketch.
Upgrade your Python environment to 3.7 or newer. If you need older Python support, use `ddsketch<3.0.0`.
No action needed for `ddsketch` functionality, but if you require `numpy`, add `pip install numpy` to your project's dependencies.
Access these attributes via new properties or methods (e.g., `s.min_value`, `s.max_value`) or use the newly exposed top-level `stores` and `mappings` for custom implementations. Review the v2.0.0 release notes for specific attribute replacements.
Install with `pip install ddsketch[serialization]` to ensure Protobuf functionality is available.
Update import statements from `from ddsketch.ddsketch import DDSketch` to `from ddsketch import DDSketch`.
Remove the `count` keyword argument when calling `DDSketch.add()`. If you need to add a value multiple times, call `add()` repeatedly or use the `weight` parameter if adding a value with a specific weight.
Replace calls like `s.add(value, count=N)` with a loop, e.g., `for _ in range(N): s.add(value)`.
Ensure the library is installed using pip: `pip install ddsketch`. If it's installed, double-check the import statement for typos, it should be `from ddsketch import DDSketch`.
The correct way to import the main class is `from ddsketch import DDSketch`. Ensure the capitalization and class name are exact as `DDSketch`.
Instantiate the DDSketch without arguments: `sketch = DDSketch()`. If you intend to set configuration like `relative_accuracy`, use the appropriate constructor or setter methods if they exist, or refer to the documentation for advanced constructors like `DDSketch(relative_accuracy=0.01)` if available in a specific version or subclass.