Skip to content

Commit

Permalink
Merge branch 'main' of github.com:pola-rs/nodejs-polars into nodejs-p…
Browse files Browse the repository at this point in the history
…olars-v0.16.0
  • Loading branch information
universalmind303 committed Sep 23, 2024
2 parents 5d9b4bc + ac4c358 commit cc49e3c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
16 changes: 11 additions & 5 deletions polars/dataframe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,7 @@ export interface DataFrame
*/
melt(idVars: ColumnSelection, valueVars: ColumnSelection): DataFrame;
/**
* Unpivot DataFrame to long format.
* Unpivot a DataFrame from wide to long format.
* ___
*
* @param idVars - Columns to use as identifier variables.
Expand Down Expand Up @@ -1029,9 +1029,15 @@ export interface DataFrame
/**
* Create a spreadsheet-style pivot table as a DataFrame.
*
* @param values Column values to aggregate. Can be multiple columns if the *columns* arguments contains multiple columns as well
* @param options.index One or multiple keys to group by
* @param options.columns Columns whose values will be used as the header of the output DataFrame
* @param values The existing column(s) of values which will be moved under the new columns from index. If an
* aggregation is specified, these are the values on which the aggregation will be computed.
* If None, all remaining columns not specified on `on` and `index` will be used.
* At least one of `index` and `values` must be specified.
* @param options.index The column(s) that remain from the input to the output. The output DataFrame will have one row
* for each unique combination of the `index`'s values.
* If None, all remaining columns not specified on `on` and `values` will be used. At least one
* of `index` and `values` must be specified.
* @param options.on The column(s) whose values will be used as the new columns of the output DataFrame.
* @param options.aggregateFunc
* Any of:
* - "sum"
Expand All @@ -1055,7 +1061,7 @@ export interface DataFrame
* ... "baz": [1, 2, 3, 4, 5, 6],
* ... }
* ... );
* > df.pivot("baz", {index:"foo", columns:"bar"});
* > df.pivot("baz", {index:"foo", on:"bar"});
* shape: (2, 4)
* ┌─────┬─────┬─────┬─────┐
* │ foo ┆ A ┆ B ┆ C │
Expand Down
2 changes: 1 addition & 1 deletion polars/series/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import type {
DtypeToJsName,
JsToDtype,
JsType,
} from "@polars/datatypes/datatype";
} from "../datatypes/datatype";

const inspect = Symbol.for("nodejs.util.inspect.custom");
/**
Expand Down
2 changes: 1 addition & 1 deletion src/lazy/dataframe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ pub fn scan_parquet(path: String, options: ScanParquetOptions) -> napi::Result<J
use_statistics,
hive_options,
glob,
include_file_paths: include_file_paths.map(Arc::from),
include_file_paths: include_file_paths.map(PlSmallStr::from),
};
let lf = LazyFrame::scan_parquet(path, args).map_err(JsPolarsErr::from)?;
Ok(lf.into())
Expand Down

0 comments on commit cc49e3c

Please sign in to comment.