@@ -931,7 +931,7 @@ export interface DataFrame
931
931
*/
932
932
melt ( idVars : ColumnSelection , valueVars : ColumnSelection ) : DataFrame ;
933
933
/**
934
- * Unpivot DataFrame to long format.
934
+ * Unpivot a DataFrame from wide to long format.
935
935
* ___
936
936
*
937
937
* @param idVars - Columns to use as identifier variables.
@@ -1029,9 +1029,15 @@ export interface DataFrame
1029
1029
/**
1030
1030
* Create a spreadsheet-style pivot table as a DataFrame.
1031
1031
*
1032
- * @param values Column values to aggregate. Can be multiple columns if the *columns* arguments contains multiple columns as well
1033
- * @param options.index One or multiple keys to group by
1034
- * @param options.columns Columns whose values will be used as the header of the output DataFrame
1032
+ * @param values The existing column(s) of values which will be moved under the new columns from index. If an
1033
+ * aggregation is specified, these are the values on which the aggregation will be computed.
1034
+ * If None, all remaining columns not specified on `on` and `index` will be used.
1035
+ * At least one of `index` and `values` must be specified.
1036
+ * @param options.index The column(s) that remain from the input to the output. The output DataFrame will have one row
1037
+ * for each unique combination of the `index`'s values.
1038
+ * If None, all remaining columns not specified on `on` and `values` will be used. At least one
1039
+ * of `index` and `values` must be specified.
1040
+ * @param options.on The column(s) whose values will be used as the new columns of the output DataFrame.
1035
1041
* @param options.aggregateFunc
1036
1042
* Any of:
1037
1043
* - "sum"
@@ -1055,7 +1061,7 @@ export interface DataFrame
1055
1061
* ... "baz": [1, 2, 3, 4, 5, 6],
1056
1062
* ... }
1057
1063
* ... );
1058
- * > df.pivot("baz", {index:"foo", columns :"bar"});
1064
+ * > df.pivot("baz", {index:"foo", on :"bar"});
1059
1065
* shape: (2, 4)
1060
1066
* ┌─────┬─────┬─────┬─────┐
1061
1067
* │ foo ┆ A ┆ B ┆ C │
0 commit comments