plotkit-polars 0.4.0

Polars DataFrame/Series integration for plotkit
Documentation
  • Coverage
  • 100%
    1 out of 1 items documented1 out of 1 items with examples
  • Size
  • Source code size: 35.43 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 648.41 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 26s Average build duration of successful builds.
  • all releases: 25s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • anonymousAAK/plotrs
    2 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • anonymousAAK

Polars integration for plotkit.

This crate activates Polars support in plotkit-core, providing IntoSeries and IntoCategories implementations for Polars Series. Depend on this crate (or enable the polars feature on the plotkit umbrella crate) to pass Polars data directly to any plotkit charting function.

Supported types

Type Conversion
&Series (numeric: f64, f32, i32, i64, u32, u64) O(n) cast to f64, nulls become NAN
Series (numeric, owned) delegates to borrowed impl
&Series (string / Utf8) O(n) extraction to Vec<String>, nulls become "null"

Examples

use polars::prelude::*;
use plotkit_core::series::IntoSeries;

let s = Series::new("values".into(), &[1.0_f64, 2.0, 3.0]);
let plotkit_series = (&s).into_series();
assert_eq!(plotkit_series.data, vec![1.0, 2.0, 3.0]);