diff --git a/polars/src/docs/eager.rs b/polars/src/docs/eager.rs index 670fac34b3b0..a89fea0f174b 100644 --- a/polars/src/docs/eager.rs +++ b/polars/src/docs/eager.rs @@ -392,7 +392,7 @@ //! temp.outer_join(&rain, ["days"], ["days"]); //! //! // join on multiple columns -//! temp.join(&rain, vec!["days", "other"], vec!["days", "other"], JoinType::Left, None); +//! temp.join(&rain, vec!["days", "other"], vec!["days", "other"], JoinArgs::new(JoinType::Left)); //! //! # Ok(()) //! # } @@ -435,9 +435,7 @@ //! )?; //! //! // groupby "foo" | pivot "bar" column | aggregate "N" -//! let pivoted = df.groupby(["foo"])? -//! .pivot(["bar"], ["N"]) -//! .first(); +//! let pivoted = pivot::pivot(&df, ["foo"], ["bar"], ["N"], false, Some(first()), None); //! //! // pivoted: //! // +-----+------+------+------+------+------+ @@ -631,7 +629,7 @@ //! use polars::prelude::*; //! use std::fs::File; //! -//! # fn example(df: &mut DataFrame) -> PolarsResult<()> { +//! # fn example(df: &mut DataFrame) -> PolarsResult { //! // create a file //! let file = File::create("example.parquet").expect("could not create file"); //! diff --git a/polars/src/docs/lazy.rs b/polars/src/docs/lazy.rs index 48408258bb9e..2cc5aa8064cc 100644 --- a/polars/src/docs/lazy.rs +++ b/polars/src/docs/lazy.rs @@ -145,7 +145,7 @@ //! let lf_a = df_a.clone().lazy(); //! let lf_b = df_b.clone().lazy(); //! -//! let joined = lf_a.join(lf_b, vec![col("a")], vec![col("foo")], JoinType::Outer).collect()?; +//! let joined = lf_a.join(lf_b, vec![col("a")], vec![col("foo")], JoinArgs::new(JoinType::Outer)).collect()?; //! // joined: //! //! // ╭─────┬─────┬─────┬──────┬─────────╮ @@ -241,7 +241,7 @@ //! that you need to pass the values to an external function you do not control. The snippet below //! shows how we use the `Struct` datatype to be able to apply a function over multiple inputs. //! -//! ``` +//! ```ignore //! use polars::prelude::*; //! fn my_black_box_function(a: f32, b: f32) -> f32 { //! // do something diff --git a/polars/src/docs/performance.rs b/polars/src/docs/performance.rs index f6fc502f38fe..466fb54c2ae4 100644 --- a/polars/src/docs/performance.rs +++ b/polars/src/docs/performance.rs @@ -64,7 +64,7 @@ //! //! df_a.try_apply("a", |s| s.categorical().cloned())?; //! df_b.try_apply("b", |s| s.categorical().cloned())?; -//! df_a.join(&df_b, ["a"], ["b"], JoinType::Inner, None) +//! df_a.join(&df_b, ["a"], ["b"], JoinArgs::new(JoinType::Inner)) //! } //! ``` //! diff --git a/polars/src/lib.rs b/polars/src/lib.rs index 25676ce8f804..9f1e0f2f8f2f 100644 --- a/polars/src/lib.rs +++ b/polars/src/lib.rs @@ -18,7 +18,7 @@ //! .agg([ //! // expressions can be combined into powerful aggregations //! col("foo") -//! .sort_by([col("ham").rank(Default::default())], [false]) +//! .sort_by([col("ham").rank(Default::default(), None)], [false]) //! .last() //! .alias("last_foo_ranked_by_ham"), //! // every expression runs in parallel @@ -31,7 +31,7 @@ //! .select([col("ham"), col("spam")]); //! //! let df = lf1 -//! .join(lf2, [col("reverse")], [col("foo")], JoinType::Left) +//! .join(lf2, [col("reverse")], [col("foo")], JoinArgs::new(JoinType::Left)) //! // now we finally materialize the result. //! .collect()?; //! # Ok(()) @@ -325,28 +325,24 @@ //! //! ## Config with ENV vars //! -//! * `POLARS_FMT_TABLE_FORMATTING` -> define styling of tables using any of the following options (default = UTF8_FULL_CONDENSED): -//! -//! ASCII_FULL -//! ASCII_FULL_CONDENSED -//! ASCII_NO_BORDERS -//! ASCII_BORDERS_ONLY -//! ASCII_BORDERS_ONLY_CONDENSED -//! ASCII_HORIZONTAL_ONLY -//! ASCII_MARKDOWN -//! UTF8_FULL -//! UTF8_FULL_CONDENSED -//! UTF8_NO_BORDERS -//! UTF8_BORDERS_ONLY -//! UTF8_HORIZONTAL_ONLY -//! NOTHING -//! -//! These options are defined by comfy-table which provides examples for each at: -//! https://github.com/Nukesor/comfy-table/blob/main/src/style/presets.rs +//! * `POLARS_FMT_TABLE_FORMATTING` -> define styling of tables using any of the following options (default = UTF8_FULL_CONDENSED). These options are defined by comfy-table which provides examples for each at +//! * `ASCII_FULL` +//! * `ASCII_FULL_CONDENSED` +//! * `ASCII_NO_BORDERS` +//! * `ASCII_BORDERS_ONLY` +//! * `ASCII_BORDERS_ONLY_CONDENSED` +//! * `ASCII_HORIZONTAL_ONLY` +//! * `ASCII_MARKDOWN` +//! * `UTF8_FULL` +//! * `UTF8_FULL_CONDENSED` +//! * `UTF8_NO_BORDERS` +//! * `UTF8_BORDERS_ONLY` +//! * `UTF8_HORIZONTAL_ONLY` +//! * `NOTHING` //! * `POLARS_FMT_TABLE_CELL_ALIGNMENT` -> define cell alignment using any of the following options (default = LEFT): -//! LEFT -//! CENTER -//! RIGHT +//! * `LEFT` +//! * `CENTER` +//! * `RIGHT` //! * `POLARS_FMT_TABLE_DATAFRAME_SHAPE_BELOW` -> print shape information below the table. //! * `POLARS_FMT_TABLE_HIDE_COLUMN_NAMES` -> hide table column names. //! * `POLARS_FMT_TABLE_HIDE_COLUMN_DATA_TYPES` -> hide data types for columns.