df-script 1.9.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/README.md +148 -235
  2. package/dist/api.d.ts +41 -36
  3. package/dist/columnExpressions/ColumnExpr.d.ts +5 -8
  4. package/dist/columnExpressions/functions/all.d.ts +13 -13
  5. package/dist/columnExpressions/functions/coalesce.d.ts +2 -2
  6. package/dist/columnExpressions/functions/duration.d.ts +16 -21
  7. package/dist/columnExpressions/functions/element.d.ts +10 -10
  8. package/dist/columnExpressions/functions/exclude.d.ts +14 -14
  9. package/dist/columnExpressions/functions/implode.d.ts +7 -7
  10. package/dist/columnExpressions/functions/lit.d.ts +9 -9
  11. package/dist/columnExpressions/functions/seqRange.d.ts +69 -0
  12. package/dist/columnExpressions/functions/struct.d.ts +6 -6
  13. package/dist/columnExpressions/functions/when.d.ts +25 -28
  14. package/dist/columnExpressions/index.d.ts +3 -7
  15. package/dist/columnExpressions/mixins/AggregationExpr.d.ts +550 -221
  16. package/dist/columnExpressions/mixins/ArithmeticExpr.d.ts +701 -327
  17. package/dist/columnExpressions/mixins/ArrayExpr.d.ts +508 -212
  18. package/dist/columnExpressions/mixins/ComparisonExpr.d.ts +398 -201
  19. package/dist/columnExpressions/mixins/LogicalExpr.d.ts +59 -29
  20. package/dist/columnExpressions/mixins/ManipulationExpr.d.ts +23 -9
  21. package/dist/columnExpressions/mixins/StandardExpr.d.ts +3234 -0
  22. package/dist/columnExpressions/mixins/StringExpr.d.ts +1163 -524
  23. package/dist/columnExpressions/mixins/StructExpr.d.ts +67 -25
  24. package/dist/columnExpressions/mixins/TemporalExpr.d.ts +518 -212
  25. package/dist/columnExpressions/mixins/WindowExpr.d.ts +270 -102
  26. package/dist/columnExpressions/typeInference.d.ts +3 -3
  27. package/dist/columnExpressions/types.d.ts +5 -0
  28. package/dist/columnExpressions/utils.d.ts +7 -0
  29. package/dist/constants.d.ts +11 -2
  30. package/dist/dataframe/dataframe.d.ts +755 -592
  31. package/dist/dataframe/grouped/grouped.d.ts +24 -6
  32. package/dist/dataframe/grouped.d.ts +70 -0
  33. package/dist/dataframe/index.d.ts +1 -1
  34. package/dist/dataframe/lazy.d.ts +37 -0
  35. package/dist/dataframe/types.d.ts +46 -22
  36. package/dist/dataframe/utils.d.ts +10 -4
  37. package/dist/datatypes/index.d.ts +11 -4
  38. package/dist/expressions.js +1 -0
  39. package/dist/expressions.mjs +1 -0
  40. package/dist/functions/concat.d.ts +68 -16
  41. package/dist/functions/index.d.ts +2 -2
  42. package/dist/functions/readCsv.d.ts +35 -0
  43. package/dist/functions/readJson.d.ts +33 -0
  44. package/dist/index.js +5 -6
  45. package/dist/index.mjs +5 -6
  46. package/dist/types.d.ts +42 -9
  47. package/dist/utils/array.d.ts +17 -14
  48. package/dist/utils/csv.d.ts +4 -1
  49. package/dist/utils/date.d.ts +3 -19
  50. package/dist/utils/duration.d.ts +7 -5
  51. package/dist/utils/json.d.ts +5 -3
  52. package/dist/utils/object.d.ts +0 -18
  53. package/dist/utils/string.d.ts +5 -0
  54. package/dist/utils.js +4 -0
  55. package/dist/utils.mjs +4 -0
  56. package/package.json +29 -8
  57. package/dist/assets/index-DBhGK6Tp.css +0 -1
  58. package/dist/assets/index-DEJEV_tU.js +0 -195
  59. package/dist/index.html +0 -17
@@ -12,80 +12,88 @@ export declare class AggregationExpr extends ExprBase {
12
12
  * Aggregation: Returns true if all values in the group are truthy.
13
13
  * @returns ColumnExpression
14
14
  * @example
15
- * >>> const df = $df.data({ group: ["A", "A", "B"], val: [true, true, false] })
16
- * >>> df.group_by("group").agg($df.col("val").all().alias("all_true"))
17
- * shape: (2, 2)
18
- * ┌───────┬──────────┐
19
- * │ group all_true
20
- * ├───────┼──────────┤
21
- * │ "A" │ true
22
- * │ "B" │ false
23
- * └───────┴──────────┘
15
+ * >>> const df = $df.data({ a: [true, true, false, false], b: [true, false, true, false] })
16
+ * >>> df
17
+ * shape: (4, 2)
18
+ * ┌───────┬───────┐
19
+ * │ a b
20
+ * ├───────┼───────┤
21
+ * │ true │ true
22
+ * │ true │ false
23
+ * │ false │ true │
24
+ * │ false │ false │
25
+ * └───────┴───────┘
26
+ * >>> df.select($df.col("a").all().alias("all_true"))
27
+ * shape: (1, 1)
28
+ * ┌──────────┐
29
+ * │ all_true │
30
+ * ├──────────┤
31
+ * │ false │
32
+ * └──────────┘
24
33
  */
25
34
  all(): this;
26
- /**
27
- * Aggregation: Checks if all values in the group are null.
28
- * @returns ColumnExpression
29
- * @example
30
- * >>> const df = $df.data({ group: ["A", "A"], val: [null, null] })
31
- * >>> df.group_by("group").agg($df.col("val").all_null().alias("is_null"))
32
- * shape: (1, 2)
33
- * ┌───────┬─────────┐
34
- * │ group │ is_null │
35
- * ├───────┼─────────┤
36
- * │ "A" │ true │
37
- * └───────┴─────────┘
38
- */
39
- all_null(): this;
40
35
  /**
41
36
  * Aggregation: Checks if any value in the group is truthy.
42
37
  * @returns ColumnExpression
43
38
  * @example
44
- * >>> const df = $df.data({ group: ["A", "A", "B"], val: [true, false, false] })
45
- * >>> df.group_by("group").agg($df.col("val").any().alias("any_true"))
46
- * shape: (2, 2)
47
- * ┌───────┬──────────┐
48
- * │ group any_true
49
- * ├───────┼──────────┤
50
- * │ "A" │ true
51
- * │ "B" │ false
52
- * └───────┴──────────┘
39
+ * >>> const df = $df.data({ a: [true, true, false, false], b: [true, false, true, false] })
40
+ * >>> df
41
+ * shape: (4, 2)
42
+ * ┌───────┬───────┐
43
+ * │ a b
44
+ * ├───────┼───────┤
45
+ * │ true │ true
46
+ * │ true │ false
47
+ * │ false │ true │
48
+ * │ false │ false │
49
+ * └───────┴───────┘
50
+ * >>> df.select($df.col("a").any().alias("any_true"))
51
+ * shape: (1, 1)
52
+ * ┌──────────┐
53
+ * │ any_true │
54
+ * ├──────────┤
55
+ * │ true │
56
+ * └──────────┘
53
57
  */
54
58
  any(): this;
55
- /**
56
- * Aggregation: Checks if any value in the group is null.
57
- * @returns ColumnExpression
58
- * @example
59
- * >>> const df = $df.data({ group: ["A", "A"], val: [10, null] })
60
- * >>> df.group_by("group").agg($df.col("val").any_null().alias("has_null"))
61
- * shape: (1, 2)
62
- * ┌───────┬──────────┐
63
- * │ group │ has_null │
64
- * ├───────┼──────────┤
65
- * │ "A" │ true │
66
- * └───────┴──────────┘
67
- */
68
- any_null(): this;
69
59
  /**
70
60
  * Aggregation: Finds the index of the maximum value in the group.
71
61
  * @returns ColumnExpression
72
62
  * @example
73
- * >>> const df = $df.data({ val: [10, 50, 20] })
74
- * >>> df.select($df.col("val").arg_max().alias("max_idx"))
63
+ * >>> const df = $df.data({ a: [1, 2, 3] })
64
+ * >>> df
65
+ * shape: (3, 1)
66
+ * ┌───┐
67
+ * │ a │
68
+ * ├───┤
69
+ * │ 1 │
70
+ * │ 2 │
71
+ * │ 3 │
72
+ * └───┘
73
+ * >>> df.select($df.col("val").argMax().alias("max_idx"))
75
74
  * shape: (1, 1)
76
75
  * ┌─────────┐
77
76
  * │ max_idx │
78
77
  * ├─────────┤
79
- * │ 1
78
+ * │ 2
80
79
  * └─────────┘
81
80
  */
82
- arg_max(): this;
81
+ argMax(): this;
83
82
  /**
84
83
  * Aggregation: Finds the index of the minimum value in the group.
85
84
  * @returns ColumnExpression
86
85
  * @example
87
- * >>> const df = $df.data({ val: [10, 50, 20] })
88
- * >>> df.select($df.col("val").arg_min().alias("min_idx"))
86
+ * >>> const df = $df.data({ a: [1, 2, 3] })
87
+ * >>> df
88
+ * shape: (3, 1)
89
+ * ┌───┐
90
+ * │ a │
91
+ * ├───┤
92
+ * │ 1 │
93
+ * │ 2 │
94
+ * │ 3 │
95
+ * └───┘
96
+ * >>> df.select($df.col("val").argMin().alias("min_idx"))
89
97
  * shape: (1, 1)
90
98
  * ┌─────────┐
91
99
  * │ min_idx │
@@ -93,18 +101,28 @@ export declare class AggregationExpr extends ExprBase {
93
101
  * │ 0 │
94
102
  * └─────────┘
95
103
  */
96
- arg_min(): this;
104
+ argMin(): this;
97
105
  /**
98
106
  * Aggregation: Computes the arithmetic mean of the group.
99
107
  * @returns ColumnExpression
100
108
  * @example
101
- * >>> const df = $df.data({ group: ["A", "A"], val: [10, 20] })
102
- * >>> df.group_by("group").agg($df.col("val").avg().alias("mean"))
103
- * shape: (1, 2)
109
+ * >>> const df = $df.data({ group: ["A", "A", "B"], val: [10, 20, 30] })
110
+ * >>> df
111
+ * shape: (3, 2)
112
+ * ┌───────┬─────┐
113
+ * │ group │ val │
114
+ * ├───────┼─────┤
115
+ * │ A │ 10 │
116
+ * │ A │ 20 │
117
+ * │ B │ 30 │
118
+ * └───────┴─────┘
119
+ * >>> df.groupBy("group").agg($df.col("val").avg().alias("mean"))
120
+ * shape: (2, 2)
104
121
  * ┌───────┬──────┐
105
122
  * │ group │ mean │
106
123
  * ├───────┼──────┤
107
- * │ "A" │ 15 │
124
+ * │ A │ 15 │
125
+ * │ B │ 30 │
108
126
  * └───────┴──────┘
109
127
  */
110
128
  avg(): this;
@@ -112,22 +130,40 @@ export declare class AggregationExpr extends ExprBase {
112
130
  * Aggregation: Computes bitwise AND across all elements in the group.
113
131
  * @returns ColumnExpression
114
132
  * @example
115
- * >>> const df = $df.data({ val: [0b11, 0b10] })
116
- * >>> df.select($df.col("val").bitwise_and().alias("res"))
133
+ * >>> const df = $df.data({ a: [1, 2, 3] })
134
+ * >>> df
135
+ * shape: (3, 1)
136
+ * ┌───┐
137
+ * │ a │
138
+ * ├───┤
139
+ * │ 1 │
140
+ * │ 2 │
141
+ * │ 3 │
142
+ * └───┘
143
+ * >>> df.select($df.col("a").bitwiseAnd().alias("res"))
117
144
  * shape: (1, 1)
118
145
  * ┌─────┐
119
146
  * │ res │
120
147
  * ├─────┤
121
- * │ 2
148
+ * │ 0
122
149
  * └─────┘
123
150
  */
124
- bitwise_and(): this;
151
+ bitwiseAnd(): this;
125
152
  /**
126
153
  * Aggregation: Computes bitwise OR across all elements in the group.
127
154
  * @returns ColumnExpression
128
155
  * @example
129
- * >>> const df = $df.data({ val: [0b01, 0b10] })
130
- * >>> df.select($df.col("val").bitwise_or().alias("res"))
156
+ * >>> const df = $df.data({ a: [1, 2, 3] })
157
+ * >>> df
158
+ * shape: (3, 1)
159
+ * ┌───┐
160
+ * │ a │
161
+ * ├───┤
162
+ * │ 1 │
163
+ * │ 2 │
164
+ * │ 3 │
165
+ * └───┘
166
+ * >>> df.select($df.col("a").bitwiseOr().alias("res"))
131
167
  * shape: (1, 1)
132
168
  * ┌─────┐
133
169
  * │ res │
@@ -135,28 +171,46 @@ export declare class AggregationExpr extends ExprBase {
135
171
  * │ 3 │
136
172
  * └─────┘
137
173
  */
138
- bitwise_or(): this;
174
+ bitwiseOr(): this;
139
175
  /**
140
176
  * Aggregation: Computes bitwise XOR across all elements in the group.
141
177
  * @returns ColumnExpression
142
178
  * @example
143
- * >>> const df = $df.data({ val: [0b11, 0b10] })
144
- * >>> df.select($df.col("val").bitwise_xor().alias("res"))
179
+ * >>> const df = $df.data({ a: [1, 2, 3] })
180
+ * >>> df
181
+ * shape: (3, 1)
182
+ * ┌───┐
183
+ * │ a │
184
+ * ├───┤
185
+ * │ 1 │
186
+ * │ 2 │
187
+ * │ 3 │
188
+ * └───┘
189
+ * >>> df.select($df.col("a").bitwiseXor().alias("res"))
145
190
  * shape: (1, 1)
146
191
  * ┌─────┐
147
192
  * │ res │
148
193
  * ├─────┤
149
- * │ 1
194
+ * │ 0
150
195
  * └─────┘
151
196
  */
152
- bitwise_xor(): this;
197
+ bitwiseXor(): this;
153
198
  /**
154
199
  * Aggregation: Computes the Pearson correlation coefficient between two columns.
155
200
  * @param other The target column expression to correlate with.
156
201
  * @returns ColumnExpression
157
202
  * @example
158
- * >>> const df = $df.data({ x: [1, 2, 3], y: [2, 4, 6] })
159
- * >>> df.select($df.col("x").corr($df.col("y")).alias("correlation"))
203
+ * >>> const df = $df.data({ a: [1, 2, 3], b: [10, 20, 30] })
204
+ * >>> df
205
+ * shape: (3, 2)
206
+ * ┌───┬────┐
207
+ * │ a │ b │
208
+ * ├───┼────┤
209
+ * │ 1 │ 10 │
210
+ * │ 2 │ 20 │
211
+ * │ 3 │ 30 │
212
+ * └───┴────┘
213
+ * >>> df.select($df.col("a").corr($df.col("b")).alias("correlation"))
160
214
  * shape: (1, 1)
161
215
  * ┌─────────────┐
162
216
  * │ correlation │
@@ -170,13 +224,23 @@ export declare class AggregationExpr extends ExprBase {
170
224
  * @param options Config flags including whether to count null values.
171
225
  * @returns ColumnExpression
172
226
  * @example
173
- * >>> const df = $df.data({ group: ["A", "A"], val: [10, null] })
174
- * >>> df.group_by("group").agg($df.col("val").count().alias("cnt"))
175
- * shape: (1, 2)
227
+ * >>> const df = $df.data({ group: ["A", "A", "B"], val: [10, 20, 30] })
228
+ * >>> df
229
+ * shape: (3, 2)
230
+ * ┌───────┬─────┐
231
+ * │ group │ val │
232
+ * ├───────┼─────┤
233
+ * │ A │ 10 │
234
+ * │ A │ 20 │
235
+ * │ B │ 30 │
236
+ * └───────┴─────┘
237
+ * >>> df.groupBy("group").agg($df.col("val").count().alias("cnt"))
238
+ * shape: (2, 2)
176
239
  * ┌───────┬─────┐
177
240
  * │ group │ cnt │
178
241
  * ├───────┼─────┤
179
- * │ "A" 1
242
+ * │ A 2
243
+ * │ B │ 1 │
180
244
  * └───────┴─────┘
181
245
  */
182
246
  count(options?: {
@@ -187,13 +251,22 @@ export declare class AggregationExpr extends ExprBase {
187
251
  * @param other The target column expression to compute covariance with.
188
252
  * @returns ColumnExpression
189
253
  * @example
190
- * >>> const df = $df.data({ x: [1, 2, 3], y: [2, 4, 6] })
191
- * >>> df.select($df.col("x").cov($df.col("y")).alias("covariance"))
254
+ * >>> const df = $df.data({ a: [1, 2, 3], b: [10, 20, 30] })
255
+ * >>> df
256
+ * shape: (3, 2)
257
+ * ┌───┬────┐
258
+ * │ a │ b │
259
+ * ├───┼────┤
260
+ * │ 1 │ 10 │
261
+ * │ 2 │ 20 │
262
+ * │ 3 │ 30 │
263
+ * └───┴────┘
264
+ * >>> df.select($df.col("a").cov($df.col("b")).alias("covariance"))
192
265
  * shape: (1, 1)
193
266
  * ┌────────────┐
194
267
  * │ covariance │
195
268
  * ├────────────┤
196
- * │ 2
269
+ * │ 10
197
270
  * └────────────┘
198
271
  */
199
272
  cov(other: any): this;
@@ -202,13 +275,22 @@ export declare class AggregationExpr extends ExprBase {
202
275
  * @param other The other column expression to compute the dot product with.
203
276
  * @returns ColumnExpression
204
277
  * @example
205
- * >>> const df = $df.data({ x: [1, 2, 3], y: [2, 3, 4] })
206
- * >>> df.select($df.col("x").dot($df.col("y")).alias("dot_product"))
278
+ * >>> const df = $df.data({ a: [1, 2, 3], b: [10, 20, 30] })
279
+ * >>> df
280
+ * shape: (3, 2)
281
+ * ┌───┬────┐
282
+ * │ a │ b │
283
+ * ├───┼────┤
284
+ * │ 1 │ 10 │
285
+ * │ 2 │ 20 │
286
+ * │ 3 │ 30 │
287
+ * └───┴────┘
288
+ * >>> df.select($df.col("a").dot($df.col("b")).alias("dot_product"))
207
289
  * shape: (1, 1)
208
290
  * ┌─────────────┐
209
291
  * │ dot_product │
210
292
  * ├─────────────┤
211
- * │ 20
293
+ * │ 140
212
294
  * └─────────────┘
213
295
  */
214
296
  dot(other: any): this;
@@ -217,13 +299,22 @@ export declare class AggregationExpr extends ExprBase {
217
299
  * @param options Entropy options ({ base?: number, normalize?: boolean }, default base=Math.E, normalize=true).
218
300
  * @returns ColumnExpression
219
301
  * @example
220
- * >>> const df = $df.data({ val: ["a", "b", "a", "c"] })
221
- * >>> df.select($df.col("val").entropy().alias("h"))
302
+ * >>> const df = $df.data({ a: [1, 2, 3] })
303
+ * >>> df
304
+ * shape: (3, 1)
305
+ * ┌───┐
306
+ * │ a │
307
+ * ├───┤
308
+ * │ 1 │
309
+ * │ 2 │
310
+ * │ 3 │
311
+ * └───┘
312
+ * >>> df.select($df.col("a").entropy().alias("h"))
222
313
  * shape: (1, 1)
223
314
  * ┌──────────┐
224
315
  * │ h │
225
316
  * ├──────────┤
226
- * │ 1.039721
317
+ * │ 1.386294
227
318
  * └──────────┘
228
319
  */
229
320
  entropy(options?: EntropyOptions): this;
@@ -231,27 +322,70 @@ export declare class AggregationExpr extends ExprBase {
231
322
  * Aggregation: Finds the first value in the group.
232
323
  * @returns ColumnExpression
233
324
  * @example
234
- * >>> const df = $df.data({ group: ["A", "A"], val: [10, 20] })
235
- * >>> df.group_by("group").agg($df.col("val").first().alias("first_val"))
236
- * shape: (1, 2)
325
+ * >>> const df = $df.data({ group: ["A", "A", "B"], val: [10, 20, 30] })
326
+ * >>> df
327
+ * shape: (3, 2)
328
+ * ┌───────┬─────┐
329
+ * │ group │ val │
330
+ * ├───────┼─────┤
331
+ * │ A │ 10 │
332
+ * │ A │ 20 │
333
+ * │ B │ 30 │
334
+ * └───────┴─────┘
335
+ * >>> df.groupBy("group").agg($df.col("val").first().alias("first_val"))
336
+ * shape: (2, 2)
237
337
  * ┌───────┬───────────┐
238
338
  * │ group │ first_val │
239
339
  * ├───────┼───────────┤
240
- * │ "A" │ 10 │
340
+ * │ A │ 10 │
341
+ * │ B │ 30 │
241
342
  * └───────┴───────────┘
242
343
  */
243
344
  first(): this;
345
+ /**
346
+ * Aggregation: Checks if any value in the group is null.
347
+ * @returns ColumnExpression
348
+ * @example
349
+ * >>> const df = $df.data({ a: [1, null, 3], b: [null, 2, null] })
350
+ * >>> df
351
+ * shape: (3, 2)
352
+ * ┌──────┬──────┐
353
+ * │ a │ b │
354
+ * ├──────┼──────┤
355
+ * │ 1 │ null │
356
+ * │ null │ 2 │
357
+ * │ 3 │ null │
358
+ * └──────┴──────┘
359
+ * >>> df.select($df.col("a").hasNulls().alias("has_nulls"))
360
+ * shape: (1, 1)
361
+ * ┌───────────┐
362
+ * │ has_nulls │
363
+ * ├───────────┤
364
+ * │ true │
365
+ * └───────────┘
366
+ */
367
+ hasNulls(): this;
244
368
  /**
245
369
  * Aggregation: Combines all values in the group into a single array/list cell.
246
370
  * @returns ColumnExpression
247
371
  * @example
248
- * >>> const df = $df.data({ group: ["A", "A"], val: [10, 20] })
249
- * >>> df.group_by("group").agg($df.col("val").implode().alias("list_val"))
250
- * shape: (1, 2)
372
+ * >>> const df = $df.data({ group: ["A", "A", "B"], val: [10, 20, 30] })
373
+ * >>> df
374
+ * shape: (3, 2)
375
+ * ┌───────┬─────┐
376
+ * │ group │ val │
377
+ * ├───────┼─────┤
378
+ * │ A │ 10 │
379
+ * │ A │ 20 │
380
+ * │ B │ 30 │
381
+ * └───────┴─────┘
382
+ * >>> df.groupBy("group").agg($df.col("val").implode().alias("list_val"))
383
+ * shape: (2, 2)
251
384
  * ┌───────┬──────────┐
252
385
  * │ group │ list_val │
253
386
  * ├───────┼──────────┤
254
- * │ "A" │ [10, 20] │
387
+ * │ A │ [10, 20] │
388
+ * │ B │ [30] │
255
389
  * └───────┴──────────┘
256
390
  */
257
391
  implode(): this;
@@ -260,13 +394,22 @@ export declare class AggregationExpr extends ExprBase {
260
394
  * @param options Kurtosis calculation options ({ fisher?: boolean, bias?: boolean }, default fisher=true, bias=true).
261
395
  * @returns ColumnExpression
262
396
  * @example
263
- * >>> const df = $df.data({ val: [1, 2, 3, 4, 5] })
264
- * >>> df.select($df.col("val").kurtosis().alias("kurt"))
397
+ * >>> const df = $df.data({ a: [1, 2, 3] })
398
+ * >>> df
399
+ * shape: (3, 1)
400
+ * ┌───┐
401
+ * │ a │
402
+ * ├───┤
403
+ * │ 1 │
404
+ * │ 2 │
405
+ * │ 3 │
406
+ * └───┘
407
+ * >>> df.select($df.col("a").kurtosis().alias("kurt"))
265
408
  * shape: (1, 1)
266
409
  * ┌───────┐
267
410
  * │ kurt │
268
411
  * ├───────┤
269
- * │ -1.3
412
+ * │ -1.36
270
413
  * └───────┘
271
414
  */
272
415
  kurtosis(options?: KurtosisOptions): this;
@@ -274,13 +417,23 @@ export declare class AggregationExpr extends ExprBase {
274
417
  * Aggregation: Finds the last value in the group.
275
418
  * @returns ColumnExpression
276
419
  * @example
277
- * >>> const df = $df.data({ group: ["A", "A"], val: [10, 20] })
278
- * >>> df.group_by("group").agg($df.col("val").last().alias("last_val"))
279
- * shape: (1, 2)
420
+ * >>> const df = $df.data({ group: ["A", "A", "B"], val: [10, 20, 30] })
421
+ * >>> df
422
+ * shape: (3, 2)
423
+ * ┌───────┬─────┐
424
+ * │ group │ val │
425
+ * ├───────┼─────┤
426
+ * │ A │ 10 │
427
+ * │ A │ 20 │
428
+ * │ B │ 30 │
429
+ * └───────┴─────┘
430
+ * >>> df.groupBy("group").agg($df.col("val").last().alias("last_val"))
431
+ * shape: (2, 2)
280
432
  * ┌───────┬──────────┐
281
433
  * │ group │ last_val │
282
434
  * ├───────┼──────────┤
283
- * │ "A" │ 20 │
435
+ * │ A │ 20 │
436
+ * │ B │ 30 │
284
437
  * └───────┴──────────┘
285
438
  */
286
439
  last(): this;
@@ -288,13 +441,23 @@ export declare class AggregationExpr extends ExprBase {
288
441
  * Aggregation: Finds the maximum value in the group.
289
442
  * @returns ColumnExpression
290
443
  * @example
291
- * >>> const df = $df.data({ group: ["A", "A"], val: [10, 50] })
292
- * >>> df.group_by("group").agg($df.col("val").max().alias("max_val"))
293
- * shape: (1, 2)
444
+ * >>> const df = $df.data({ group: ["A", "A", "B"], val: [10, 20, 30] })
445
+ * >>> df
446
+ * shape: (3, 2)
447
+ * ┌───────┬─────┐
448
+ * │ group │ val │
449
+ * ├───────┼─────┤
450
+ * │ A │ 10 │
451
+ * │ A │ 20 │
452
+ * │ B │ 30 │
453
+ * └───────┴─────┘
454
+ * >>> df.groupBy("group").agg($df.col("val").max().alias("max_val"))
455
+ * shape: (2, 2)
294
456
  * ┌───────┬─────────┐
295
457
  * │ group │ max_val │
296
458
  * ├───────┼─────────┤
297
- * │ "A" 50
459
+ * │ A 20
460
+ * │ B │ 30 │
298
461
  * └───────┴─────────┘
299
462
  */
300
463
  max(): this;
@@ -303,27 +466,46 @@ export declare class AggregationExpr extends ExprBase {
303
466
  * @param by Column or expression to order by.
304
467
  * @returns ColumnExpression
305
468
  * @example
306
- * >>> const df = $df.data({ name: ["a", "b", "c"], score: [10, 50, 20] })
307
- * >>> df.select($df.col("name").max_by($df.col("score")).alias("top_scorer"))
469
+ * >>> const df = $df.data({ group: ["A", "A", "B"], val: [10, 20, 30] })
470
+ * >>> df
471
+ * shape: (3, 2)
472
+ * ┌───────┬─────┐
473
+ * │ group │ val │
474
+ * ├───────┼─────┤
475
+ * │ A │ 10 │
476
+ * │ A │ 20 │
477
+ * │ B │ 30 │
478
+ * └───────┴─────┘
479
+ * >>> df.select($df.col("group").maxBy($df.col("val")).alias("top_group"))
308
480
  * shape: (1, 1)
309
- * ┌────────────┐
310
- * │ top_scorer
311
- * ├────────────┤
312
- * │ "b"
313
- * └────────────┘
481
+ * ┌───────────┐
482
+ * │ top_group
483
+ * ├───────────┤
484
+ * │ B
485
+ * └───────────┘
314
486
  */
315
- max_by(by: any): this;
487
+ maxBy(by: any): this;
316
488
  /**
317
489
  * Aggregation: Computes the arithmetic mean of elements in the group.
318
490
  * @returns ColumnExpression
319
491
  * @example
320
- * >>> const df = $df.data({ group: ["A", "A"], val: [10, 30] })
321
- * >>> df.group_by("group").agg($df.col("val").mean().alias("mean_val"))
322
- * shape: (1, 2)
492
+ * >>> const df = $df.data({ group: ["A", "A", "B"], val: [10, 20, 30] })
493
+ * >>> df
494
+ * shape: (3, 2)
495
+ * ┌───────┬─────┐
496
+ * │ group │ val │
497
+ * ├───────┼─────┤
498
+ * │ A │ 10 │
499
+ * │ A │ 20 │
500
+ * │ B │ 30 │
501
+ * └───────┴─────┘
502
+ * >>> df.groupBy("group").agg($df.col("val").mean().alias("mean_val"))
503
+ * shape: (2, 2)
323
504
  * ┌───────┬──────────┐
324
505
  * │ group │ mean_val │
325
506
  * ├───────┼──────────┤
326
- * │ "A" 20
507
+ * │ A 15
508
+ * │ B │ 30 │
327
509
  * └───────┴──────────┘
328
510
  */
329
511
  mean(): this;
@@ -331,13 +513,23 @@ export declare class AggregationExpr extends ExprBase {
331
513
  * Aggregation: Computes the 50th percentile median.
332
514
  * @returns ColumnExpression
333
515
  * @example
334
- * >>> const df = $df.data({ group: ["A", "A", "A"], val: [10, 50, 20] })
335
- * >>> df.group_by("group").agg($df.col("val").median().alias("med"))
336
- * shape: (1, 2)
516
+ * >>> const df = $df.data({ group: ["A", "A", "B"], val: [10, 20, 30] })
517
+ * >>> df
518
+ * shape: (3, 2)
519
+ * ┌───────┬─────┐
520
+ * │ group │ val │
521
+ * ├───────┼─────┤
522
+ * │ A │ 10 │
523
+ * │ A │ 20 │
524
+ * │ B │ 30 │
525
+ * └───────┴─────┘
526
+ * >>> df.groupBy("group").agg($df.col("val").median().alias("med"))
527
+ * shape: (2, 2)
337
528
  * ┌───────┬─────┐
338
529
  * │ group │ med │
339
530
  * ├───────┼─────┤
340
- * │ "A" 20
531
+ * │ A 15
532
+ * │ B │ 30 │
341
533
  * └───────┴─────┘
342
534
  */
343
535
  median(): this;
@@ -345,13 +537,23 @@ export declare class AggregationExpr extends ExprBase {
345
537
  * Aggregation: Finds the minimum value in the group.
346
538
  * @returns ColumnExpression
347
539
  * @example
348
- * >>> const df = $df.data({ group: ["A", "A"], val: [10, 50] })
349
- * >>> df.group_by("group").agg($df.col("val").min().alias("min_val"))
350
- * shape: (1, 2)
540
+ * >>> const df = $df.data({ group: ["A", "A", "B"], val: [10, 20, 30] })
541
+ * >>> df
542
+ * shape: (3, 2)
543
+ * ┌───────┬─────┐
544
+ * │ group │ val │
545
+ * ├───────┼─────┤
546
+ * │ A │ 10 │
547
+ * │ A │ 20 │
548
+ * │ B │ 30 │
549
+ * └───────┴─────┘
550
+ * >>> df.groupBy("group").agg($df.col("val").min().alias("min_val"))
551
+ * shape: (2, 2)
351
552
  * ┌───────┬─────────┐
352
553
  * │ group │ min_val │
353
554
  * ├───────┼─────────┤
354
- * │ "A" │ 10 │
555
+ * │ A │ 10 │
556
+ * │ B │ 30 │
355
557
  * └───────┴─────────┘
356
558
  */
357
559
  min(): this;
@@ -360,28 +562,46 @@ export declare class AggregationExpr extends ExprBase {
360
562
  * @param by Column or expression to order by.
361
563
  * @returns ColumnExpression
362
564
  * @example
363
- * >>> const df = $df.data({ name: ["a", "b", "c"], score: [10, 50, 20] })
364
- * >>> df.select($df.col("name").min_by($df.col("score")).alias("lowest_scorer"))
565
+ * >>> const df = $df.data({ group: ["A", "A", "B"], val: [10, 20, 30] })
566
+ * >>> df
567
+ * shape: (3, 2)
568
+ * ┌───────┬─────┐
569
+ * │ group │ val │
570
+ * ├───────┼─────┤
571
+ * │ A │ 10 │
572
+ * │ A │ 20 │
573
+ * │ B │ 30 │
574
+ * └───────┴─────┘
575
+ * >>> df.select($df.col("group").minBy($df.col("val")).alias("lowest_group"))
365
576
  * shape: (1, 1)
366
577
  * ┌──────────────┐
367
- * │ lowest_scorer
578
+ * │ lowest_group
368
579
  * ├──────────────┤
369
- * │ "a"
580
+ * │ A
370
581
  * └──────────────┘
371
582
  */
372
- min_by(by: any): this;
583
+ minBy(by: any): this;
373
584
  /**
374
585
  * Aggregation: Finds the statistical mode (most frequent value).
375
586
  * @returns ColumnExpression
376
587
  * @example
377
- * >>> const df = $df.data({ group: ["A", "A", "A"], val: [5, 5, 10] })
378
- * >>> df.group_by("group").agg($df.col("val").mode().alias("mode_val"))
379
- * shape: (1, 2)
380
- * ┌───────┬──────────┐
381
- * │ group │ mode_val
382
- * ├───────┼──────────┤
383
- * │ "A" 5
384
- * └───────┴──────────┘
588
+ * >>> const df = $df.data({ group: ["A", "A", "B"], val: [10, 20, 30] })
589
+ * >>> df
590
+ * shape: (3, 2)
591
+ * ┌───────┬─────┐
592
+ * │ group │ val
593
+ * ├───────┼─────┤
594
+ * │ A 10
595
+ * │ A │ 20 │
596
+ * │ B │ 30 │
597
+ * └───────┴─────┘
598
+ * >>> df.select($df.col("group").mode().alias("mode_group"))
599
+ * shape: (1, 1)
600
+ * ┌────────────┐
601
+ * │ mode_group │
602
+ * ├────────────┤
603
+ * │ ["A"] │
604
+ * └────────────┘
385
605
  */
386
606
  mode(): this;
387
607
  /**
@@ -389,85 +609,140 @@ export declare class AggregationExpr extends ExprBase {
389
609
  * @param options Uniqueness options.
390
610
  * @returns ColumnExpression
391
611
  * @example
392
- * >>> const df = $df.data({ group: ["A", "A", "A"], val: [5, 5, 10] })
393
- * >>> df.group_by("group").agg($df.col("val").n_unique().alias("unique_cnt"))
394
- * shape: (1, 2)
395
- * ┌───────┬────────────┐
396
- * │ group │ unique_cnt
397
- * ├───────┼────────────┤
398
- * │ "A" 2
399
- * └───────┴────────────┘
612
+ * >>> const df = $df.data({ group: ["A", "A", "B"], val: [10, 20, 30] })
613
+ * >>> df
614
+ * shape: (3, 2)
615
+ * ┌───────┬─────┐
616
+ * │ group │ val
617
+ * ├───────┼─────┤
618
+ * │ A 10
619
+ * │ A │ 20 │
620
+ * │ B │ 30 │
621
+ * └───────┴─────┘
622
+ * >>> df.select($df.col("group").nUnique().alias("unique_cnt"))
623
+ * shape: (1, 1)
624
+ * ┌────────────┐
625
+ * │ unique_cnt │
626
+ * ├────────────┤
627
+ * │ 2 │
628
+ * └────────────┘
400
629
  */
401
- n_unique(options?: UniqueArrayStatsOptions): this;
630
+ nUnique(options?: UniqueArrayStatsOptions): this;
402
631
  /**
403
632
  * Aggregation: Finds the maximum value in the group, taking NaN values into account (NaN propagates).
404
633
  * @returns ColumnExpression
405
634
  * @example
406
- * >>> const df = $df.data({ group: ["A", "A"], val: [10, NaN] })
407
- * >>> df.group_by("group").agg($df.col("val").nan_max().alias("nan_max_val"))
408
- * shape: (1, 2)
409
- * ┌───────┬─────────────┐
410
- * │ group nan_max_val │
411
- * ├───────┼─────────────┤
412
- * │ "A" │ NaN
413
- * └───────┴─────────────┘
635
+ * >>> const df = $df.data({ a: [1, 2, 3] })
636
+ * >>> df
637
+ * shape: (3, 1)
638
+ * ┌───┐
639
+ * │ a
640
+ * ├───┤
641
+ * │ 1
642
+ * │ 2 │
643
+ * │ 3 │
644
+ * └───┘
645
+ * >>> df.select($df.col("val").nanMax().alias("nan_max_val"))
646
+ * shape: (1, 1)
647
+ * ┌─────────────┐
648
+ * │ nan_max_val │
649
+ * ├─────────────┤
650
+ * │ 30 │
651
+ * └─────────────┘
414
652
  */
415
- nan_max(): this;
653
+ nanMax(): this;
416
654
  /**
417
655
  * Aggregation: Finds the minimum value in the group, taking NaN values into account (NaN propagates).
418
656
  * @returns ColumnExpression
419
657
  * @example
420
- * >>> const df = $df.data({ group: ["A", "A"], val: [10, NaN] })
421
- * >>> df.group_by("group").agg($df.col("val").nan_min().alias("nan_min_val"))
422
- * shape: (1, 2)
423
- * ┌───────┬─────────────┐
424
- * │ group nan_min_val │
425
- * ├───────┼─────────────┤
426
- * │ "A" │ NaN
427
- * └───────┴─────────────┘
658
+ * >>> const df = $df.data({ a: [1, 2, 3] })
659
+ * >>> df
660
+ * shape: (3, 1)
661
+ * ┌───┐
662
+ * │ a
663
+ * ├───┤
664
+ * │ 1
665
+ * │ 2 │
666
+ * │ 3 │
667
+ * └───┘
668
+ * >>> df.select($df.col("val").nanMin().alias("nan_min_val"))
669
+ * shape: (1, 1)
670
+ * ┌─────────────┐
671
+ * │ nan_min_val │
672
+ * ├─────────────┤
673
+ * │ 10 │
674
+ * └─────────────┘
428
675
  */
429
- nan_min(): this;
676
+ nanMin(): this;
430
677
  /**
431
678
  * Aggregation: Counts the number of null or missing records.
432
679
  * @returns ColumnExpression
433
680
  * @example
434
- * >>> const df = $df.data({ group: ["A", "A"], val: [10, null] })
435
- * >>> df.group_by("group").agg($df.col("val").null_count().alias("nulls"))
436
- * shape: (1, 2)
437
- * ┌───────┬───────┐
438
- * │ group nulls
439
- * ├───────┼───────┤
440
- * │ "A" 1
441
- * └───────┴───────┘
681
+ * >>> const df = $df.data({ a: [1, null, 3], b: [null, 2, null] })
682
+ * >>> df
683
+ * shape: (3, 2)
684
+ * ┌──────┬──────┐
685
+ * │ a b
686
+ * ├──────┼──────┤
687
+ * │ 1 null
688
+ * │ null │ 2 │
689
+ * │ 3 │ null │
690
+ * └──────┴──────┘
691
+ * >>> df.select($df.col("a").nullCount().alias("nulls"))
692
+ * shape: (1, 1)
693
+ * ┌───────┐
694
+ * │ nulls │
695
+ * ├───────┤
696
+ * │ 1 │
697
+ * └───────┘
442
698
  */
443
- null_count(): this;
699
+ nullCount(): this;
444
700
  /**
445
701
  * Aggregation: Computes the specific quantile values (0.0 to 1.0).
446
702
  * @param q The quantile parameter value between 0.0 and 1.0.
447
703
  * @returns ColumnExpression
448
704
  * @example
449
- * >>> const df = $df.data({ val: [10, 20, 30, 40] })
450
- * >>> df.select($df.col("val").quantile(0.75).alias("q75"))
705
+ * >>> const df = $df.data({ a: [1, 2, 3] })
706
+ * >>> df
707
+ * shape: (3, 1)
708
+ * ┌───┐
709
+ * │ a │
710
+ * ├───┤
711
+ * │ 1 │
712
+ * │ 2 │
713
+ * │ 3 │
714
+ * └───┘
715
+ * >>> df.select($df.col("a").quantile(0.75).alias("q75"))
451
716
  * shape: (1, 1)
452
- * ┌─────┐
453
- * │ q75
454
- * ├─────┤
455
- * │ 32.5
456
- * └─────┘
717
+ * ┌──────┐
718
+ * │ q75
719
+ * ├──────┤
720
+ * │ 3.25
721
+ * └──────┘
457
722
  */
458
723
  quantile(q: number): this;
459
724
  /**
460
725
  * Aggregation: Computes the product of all elements in the group.
461
726
  * @returns ColumnExpression
462
727
  * @example
463
- * >>> const df = $df.data({ group: ["A", "A"], val: [2, 5] })
464
- * >>> df.group_by("group").agg($df.col("val").product().alias("p"))
465
- * shape: (1, 2)
466
- * ┌───────┬────┐
467
- * │ group │ p
468
- * ├───────┼────┤
469
- * │ "A" │ 10
470
- * └───────┴────┘
728
+ * >>> const df = $df.data({ group: ["A", "A", "B"], val: [10, 20, 30] })
729
+ * >>> df
730
+ * shape: (3, 2)
731
+ * ┌───────┬─────┐
732
+ * │ group │ val
733
+ * ├───────┼─────┤
734
+ * │ A │ 10
735
+ * │ A │ 20 │
736
+ * │ B │ 30 │
737
+ * └───────┴─────┘
738
+ * >>> df.groupBy("group").agg($df.col("val").product().alias("p"))
739
+ * shape: (2, 2)
740
+ * ┌───────┬─────┐
741
+ * │ group │ p │
742
+ * ├───────┼─────┤
743
+ * │ A │ 200 │
744
+ * │ B │ 30 │
745
+ * └───────┴─────┘
471
746
  */
472
747
  product(): this;
473
748
  /**
@@ -475,24 +750,41 @@ export declare class AggregationExpr extends ExprBase {
475
750
  * @param options Skew calculation options ({ bias?: boolean }, default bias=true).
476
751
  * @returns ColumnExpression
477
752
  * @example
478
- * >>> const df = $df.data({ val: [1, 2, 5, 10, 20] })
479
- * >>> df.select($df.col("val").skew().alias("skewness"))
753
+ * >>> const df = $df.data({ a: [1, 2, 3] })
754
+ * >>> df
755
+ * shape: (3, 1)
756
+ * ┌───┐
757
+ * │ a │
758
+ * ├───┤
759
+ * │ 1 │
760
+ * │ 2 │
761
+ * │ 3 │
762
+ * └───┘
763
+ * >>> df.select($df.col("a").skew().alias("skewness"))
480
764
  * shape: (1, 1)
481
765
  * ┌──────────┐
482
766
  * │ skewness │
483
767
  * ├──────────┤
484
- * │ 0.859427
768
+ * │ 0
485
769
  * └──────────┘
486
770
  */
487
771
  skew(options?: SkewOptions): this;
488
772
  /**
489
773
  * Aggregation: Computes the Spearman rank correlation coefficient.
490
-
491
774
  * @param other The other column expression to correlate with.
492
775
  * @returns ColumnExpression
493
776
  * @example
494
- * >>> const df = $df.data({ x: [1, 2, 3], y: [5, 6, 7] })
495
- * >>> df.select($df.col("x").spearman_corr($df.col("y")).alias("spearman"))
777
+ * >>> const df = $df.data({ a: [1, 2, 3], b: [10, 20, 30] })
778
+ * >>> df
779
+ * shape: (3, 2)
780
+ * ┌───┬────┐
781
+ * │ a │ b │
782
+ * ├───┼────┤
783
+ * │ 1 │ 10 │
784
+ * │ 2 │ 20 │
785
+ * │ 3 │ 30 │
786
+ * └───┴────┘
787
+ * >>> df.select($df.col("a").spearmanCorr($df.col("b")).alias("spearman"))
496
788
  * shape: (1, 1)
497
789
  * ┌──────────┐
498
790
  * │ spearman │
@@ -500,32 +792,51 @@ export declare class AggregationExpr extends ExprBase {
500
792
  * │ 1 │
501
793
  * └──────────┘
502
794
  */
503
- spearman_corr(other: any): this;
795
+ spearmanCorr(other: any): this;
504
796
  /**
505
797
  * Aggregation: Computes sample standard deviation.
506
798
  * @returns ColumnExpression
507
799
  * @example
508
- * >>> const df = $df.data({ group: ["A", "A", "A"], val: [10, 20, 30] })
509
- * >>> df.group_by("group").agg($df.col("val").std().alias("std_dev"))
510
- * shape: (1, 2)
511
- * ┌───────┬─────────┐
512
- * │ group std_dev │
513
- * ├───────┼─────────┤
514
- * │ "A" │ 10
515
- * └───────┴─────────┘
800
+ * >>> const df = $df.data({ a: [1, 2, 3] })
801
+ * >>> df
802
+ * shape: (3, 1)
803
+ * ┌───┐
804
+ * │ a
805
+ * ├───┤
806
+ * │ 1
807
+ * │ 2 │
808
+ * │ 3 │
809
+ * └───┘
810
+ * >>> df.select($df.col("val").std().alias("std_dev"))
811
+ * shape: (1, 1)
812
+ * ┌─────────┐
813
+ * │ std_dev │
814
+ * ├─────────┤
815
+ * │ 10 │
816
+ * └─────────┘
516
817
  */
517
818
  std(): this;
518
819
  /**
519
820
  * Aggregation: Computes the sum of elements in the group.
520
821
  * @returns ColumnExpression
521
822
  * @example
522
- * >>> const df = $df.data({ group: ["A", "A"], val: [10, 20] })
523
- * >>> df.group_by("group").agg($df.col("val").sum().alias("total"))
524
- * shape: (1, 2)
823
+ * >>> const df = $df.data({ group: ["A", "A", "B"], val: [10, 20, 30] })
824
+ * >>> df
825
+ * shape: (3, 2)
826
+ * ┌───────┬─────┐
827
+ * │ group │ val │
828
+ * ├───────┼─────┤
829
+ * │ A │ 10 │
830
+ * │ A │ 20 │
831
+ * │ B │ 30 │
832
+ * └───────┴─────┘
833
+ * >>> df.groupBy("group").agg($df.col("val").sum().alias("total"))
834
+ * shape: (2, 2)
525
835
  * ┌───────┬───────┐
526
836
  * │ group │ total │
527
837
  * ├───────┼───────┤
528
- * │ "A" │ 30 │
838
+ * │ A │ 30 │
839
+ * │ B │ 30 │
529
840
  * └───────┴───────┘
530
841
  */
531
842
  sum(): this;
@@ -533,14 +844,23 @@ export declare class AggregationExpr extends ExprBase {
533
844
  * Aggregation: Computes sample variance.
534
845
  * @returns ColumnExpression
535
846
  * @example
536
- * >>> const df = $df.data({ group: ["A", "A", "A"], val: [10, 20, 30] })
537
- * >>> df.group_by("group").agg($df.col("val").variance().alias("v"))
538
- * shape: (1, 2)
539
- * ┌───────┬─────┐
540
- * │ group v │
541
- * ├───────┼─────┤
542
- * │ "A" │ 100
543
- * └───────┴─────┘
847
+ * >>> const df = $df.data({ a: [1, 2, 3] })
848
+ * >>> df
849
+ * shape: (3, 1)
850
+ * ┌───┐
851
+ * │ a
852
+ * ├───┤
853
+ * │ 1
854
+ * │ 2 │
855
+ * │ 3 │
856
+ * └───┘
857
+ * >>> df.select($df.col("val").variance().alias("v"))
858
+ * shape: (1, 1)
859
+ * ┌─────┐
860
+ * │ v │
861
+ * ├─────┤
862
+ * │ 100 │
863
+ * └─────┘
544
864
  */
545
865
  variance(): this;
546
866
  /**
@@ -548,14 +868,23 @@ export declare class AggregationExpr extends ExprBase {
548
868
  * @param weights The weight values or column expression.
549
869
  * @returns ColumnExpression
550
870
  * @example
551
- * >>> const df = $df.data({ val: [10, 20], weight: [1, 3] })
552
- * >>> df.select($df.col("val").w_avg($df.col("weight")).alias("w_mean"))
871
+ * >>> const df = $df.data({ a: [1, 2, 3], b: [10, 20, 30] })
872
+ * >>> df
873
+ * shape: (3, 2)
874
+ * ┌───┬────┐
875
+ * │ a │ b │
876
+ * ├───┼────┤
877
+ * │ 1 │ 10 │
878
+ * │ 2 │ 20 │
879
+ * │ 3 │ 30 │
880
+ * └───┴────┘
881
+ * >>> df.select($df.col("a").wAvg($df.col("b")).alias("w_mean"))
553
882
  * shape: (1, 1)
554
- * ┌────────┐
555
- * │ w_mean
556
- * ├────────┤
557
- * │ 17.5
558
- * └────────┘
883
+ * ┌──────────┐
884
+ * │ w_mean
885
+ * ├──────────┤
886
+ * │ 2.333333
887
+ * └──────────┘
559
888
  */
560
- w_avg(weights: any): this;
889
+ wAvg(weights: any): this;
561
890
  }