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
@@ -10,48 +10,75 @@ export declare class ArithmeticExpr extends ExprBase {
10
10
  * Computes the absolute value of the column values.
11
11
  * @returns ColumnExpression
12
12
  * @example
13
- * >>> const df = $df.data({ a: [-1, 2, -3.5] })
14
- * >>> df.with_columns($df.col("a").abs().alias("abs_a"))
13
+ * >>> const df = $df.data({ a: [1, 2, 3] })
14
+ * >>> df
15
+ * shape: (3, 1)
16
+ * ┌───┐
17
+ * │ a │
18
+ * ├───┤
19
+ * │ 1 │
20
+ * │ 2 │
21
+ * │ 3 │
22
+ * └───┘
23
+ * >>> df.withColumns($df.col("a").abs().alias("abs_a"))
15
24
  * shape: (3, 2)
16
- * ┌──────┬───────┐
17
- * │ a │ abs_a │
18
- * ├──────┼───────┤
19
- * │ -1 │ 1 │
20
- * │ 2 │ 2 │
21
- * │ -3.5 │ 3.5
22
- * └──────┴───────┘
25
+ * ┌───┬───────┐
26
+ * │ a │ abs_a │
27
+ * ├───┼───────┤
28
+ * │ 1 │ 1 │
29
+ * │ 2 │ 2 │
30
+ * │ 3 │ 3
31
+ * └───┴───────┘
23
32
  */
24
33
  abs(): this;
25
34
  /**
26
35
  * Computes the mathematical arccosine (inverse cosine) of the column values.
27
36
  * @returns ColumnExpression
28
37
  * @example
29
- * >>> const df = $df.data({ a: [0, 0.5, 1] })
30
- * >>> df.with_columns($df.col("a").acos().alias("acos_a"))
38
+ * >>> const df = $df.data({ a: [1, 2, 3] })
39
+ * >>> df
40
+ * shape: (3, 1)
41
+ * ┌───┐
42
+ * │ a │
43
+ * ├───┤
44
+ * │ 1 │
45
+ * │ 2 │
46
+ * │ 3 │
47
+ * └───┘
48
+ * >>> df.withColumns($df.col("a").acos().alias("acos_a"))
31
49
  * shape: (3, 2)
32
- * ┌─────┬───────────┐
33
- * │ a │ acos_a
34
- * ├─────┼───────────┤
35
- * │ 0 1.570796
36
- * │ 0.51.047197
37
- * │ 1 0
38
- * └─────┴───────────┘
50
+ * ┌───┬────────┐
51
+ * │ a │ acos_a
52
+ * ├───┼────────┤
53
+ * │ 1 0
54
+ * │ 2null
55
+ * │ 3 null
56
+ * └───┴────────┘
39
57
  */
40
58
  acos(): this;
41
59
  /**
42
60
  * Computes the hyperbolic arccosine of the column values.
43
61
  * @returns ColumnExpression
44
62
  * @example
45
- * >>> const df = $df.data({ a: [1, 2, 5] })
46
- * >>> df.with_columns($df.col("a").acosh().alias("acosh_a"))
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.withColumns($df.col("a").acosh().alias("acosh_a"))
47
74
  * shape: (3, 2)
48
- * ┌───┬───────────┐
49
- * │ a │ acosh_a
50
- * ├───┼───────────┤
51
- * │ 1 │ 0
52
- * │ 2 │ 1.316957
53
- * │ 52.292431
54
- * └───┴───────────┘
75
+ * ┌───┬──────────┐
76
+ * │ a │ acosh_a
77
+ * ├───┼──────────┤
78
+ * │ 1 │ 0
79
+ * │ 2 │ 1.316958
80
+ * │ 31.762747
81
+ * └───┴──────────┘
55
82
  */
56
83
  acosh(): this;
57
84
  /**
@@ -59,8 +86,17 @@ export declare class ArithmeticExpr extends ExprBase {
59
86
  * @param val The number or column expression to add.
60
87
  * @returns ColumnExpression
61
88
  * @example
62
- * >>> const df = $df.data({ a: [1, 2, 3] })
63
- * >>> df.with_columns($df.col("a").add(10).alias("added"))
89
+ * >>> const df = $df.data({ a: [1, 2, 3] })
90
+ * >>> df
91
+ * shape: (3, 1)
92
+ * ┌───┐
93
+ * │ a │
94
+ * ├───┤
95
+ * │ 1 │
96
+ * │ 2 │
97
+ * │ 3 │
98
+ * └───┘
99
+ * >>> df.withColumns($df.col("a").add(10).alias("added"))
64
100
  * shape: (3, 2)
65
101
  * ┌───┬───────┐
66
102
  * │ a │ added │
@@ -75,48 +111,75 @@ export declare class ArithmeticExpr extends ExprBase {
75
111
  * Computes the arcsine of the column values.
76
112
  * @returns ColumnExpression
77
113
  * @example
78
- * >>> const df = $df.data({ a: [0, 0.5, 1] })
79
- * >>> df.with_columns($df.col("a").asin().alias("asin_a"))
114
+ * >>> const df = $df.data({ a: [1, 2, 3] })
115
+ * >>> df
116
+ * shape: (3, 1)
117
+ * ┌───┐
118
+ * │ a │
119
+ * ├───┤
120
+ * │ 1 │
121
+ * │ 2 │
122
+ * │ 3 │
123
+ * └───┘
124
+ * >>> df.withColumns($df.col("a").asin().alias("asin_a"))
80
125
  * shape: (3, 2)
81
- * ┌─────┬───────────┐
82
- * │ a │ asin_a
83
- * ├─────┼───────────┤
84
- * │ 0 0
85
- * │ 0.50.523598
86
- * │ 1 1.570796
87
- * └─────┴───────────┘
126
+ * ┌───┬──────────┐
127
+ * │ a │ asin_a
128
+ * ├───┼──────────┤
129
+ * │ 1 1.570796
130
+ * │ 2null
131
+ * │ 3 null
132
+ * └───┴──────────┘
88
133
  */
89
134
  asin(): this;
90
135
  /**
91
136
  * Computes the hyperbolic arcsine of the column values.
92
137
  * @returns ColumnExpression
93
138
  * @example
94
- * >>> const df = $df.data({ a: [0, 1, 2] })
95
- * >>> df.with_columns($df.col("a").asinh().alias("asinh_a"))
139
+ * >>> const df = $df.data({ a: [1, 2, 3] })
140
+ * >>> df
141
+ * shape: (3, 1)
142
+ * ┌───┐
143
+ * │ a │
144
+ * ├───┤
145
+ * │ 1 │
146
+ * │ 2 │
147
+ * │ 3 │
148
+ * └───┘
149
+ * >>> df.withColumns($df.col("a").asinh().alias("asinh_a"))
96
150
  * shape: (3, 2)
97
- * ┌───┬───────────┐
98
- * │ a │ asinh_a
99
- * ├───┼───────────┤
100
- * │ 0 │ 0
101
- * │ 10.881373
102
- * │ 2 │ 1.443635
103
- * └───┴───────────┘
151
+ * ┌───┬──────────┐
152
+ * │ a │ asinh_a
153
+ * ├───┼──────────┤
154
+ * │ 1 │ 0.881374
155
+ * │ 21.443635
156
+ * │ 3 │ 1.818446
157
+ * └───┴──────────┘
104
158
  */
105
159
  asinh(): this;
106
160
  /**
107
161
  * Computes the arctangent of the column values.
108
162
  * @returns ColumnExpression
109
163
  * @example
110
- * >>> const df = $df.data({ a: [0, 1, 2] })
111
- * >>> df.with_columns($df.col("a").atan().alias("atan_a"))
164
+ * >>> const df = $df.data({ a: [1, 2, 3] })
165
+ * >>> df
166
+ * shape: (3, 1)
167
+ * ┌───┐
168
+ * │ a │
169
+ * ├───┤
170
+ * │ 1 │
171
+ * │ 2 │
172
+ * │ 3 │
173
+ * └───┘
174
+ * >>> df.withColumns($df.col("a").atan().alias("atan_a"))
112
175
  * shape: (3, 2)
113
- * ┌───┬───────────┐
114
- * │ a │ atan_a
115
- * ├───┼───────────┤
116
- * │ 0 │ 0
117
- * │ 10.785398
118
- * │ 2 │ 1.107148
119
- * └───┴───────────┘
176
+ * ┌───┬──────────┐
177
+ * │ a │ atan_a
178
+ * ├───┼──────────┤
179
+ * │ 1 │ 0.785398
180
+ * │ 21.107149
181
+ * │ 3 │ 1.249046
182
+ * └───┴──────────┘
120
183
  */
121
184
  atan(): this;
122
185
  /**
@@ -124,62 +187,100 @@ export declare class ArithmeticExpr extends ExprBase {
124
187
  * @param val The x denominator number or column expression.
125
188
  * @returns ColumnExpression
126
189
  * @example
127
- * >>> const df = $df.data({ a: [1, 2], b: [2, 1] })
128
- * >>> df.with_columns($df.col("a").atan2($df.col("b")).alias("atan2_a"))
129
- * shape: (2, 3)
130
- * ┌───┬───┬───────────┐
131
- * │ a │ b atan2_a │
132
- * ├───┼───┼───────────┤
133
- * │ 1 │ 2 0.463647 │
134
- * │ 2 │ 1 1.107148 │
135
- * └───┴───┴───────────┘
190
+ * >>> const df = $df.data({ a: [1, 2, 3], b: [10, 20, 30] })
191
+ * >>> df
192
+ * shape: (3, 2)
193
+ * ┌───┬────┐
194
+ * │ a │ b
195
+ * ├───┼────┤
196
+ * │ 1 │ 10
197
+ * │ 2 │ 20
198
+ * │ 3 │ 30 │
199
+ * └───┴────┘
200
+ * >>> df.withColumns($df.col("a").atan2($df.col("b")).alias("atan2_a"))
201
+ * shape: (3, 3)
202
+ * ┌───┬────┬──────────┐
203
+ * │ a │ b │ atan2_a │
204
+ * ├───┼────┼──────────┤
205
+ * │ 1 │ 10 │ 0.099669 │
206
+ * │ 2 │ 20 │ 0.099669 │
207
+ * │ 3 │ 30 │ 0.099669 │
208
+ * └───┴────┴──────────┘
136
209
  */
137
210
  atan2(val: NumericArg): this;
138
211
  /**
139
212
  * Computes the hyperbolic arctangent of the column values.
140
213
  * @returns ColumnExpression
141
214
  * @example
142
- * >>> const df = $df.data({ a: [0, 0.5] })
143
- * >>> df.with_columns($df.col("a").atanh().alias("atanh_a"))
144
- * shape: (2, 2)
145
- * ┌─────┬───────────┐
146
- * │ a atanh_a
147
- * ├─────┼───────────┤
148
- * │ 0 │ 0
149
- * │ 0.5 0.549306 │
150
- * └─────┴───────────┘
215
+ * >>> const df = $df.data({ a: [1, 2, 3] })
216
+ * >>> df
217
+ * shape: (3, 1)
218
+ * ┌───┐
219
+ * │ a │
220
+ * ├───┤
221
+ * │ 1
222
+ * │ 2
223
+ * │ 3 │
224
+ * └───┘
225
+ * >>> df.withColumns($df.col("a").atanh().alias("atanh_a"))
226
+ * shape: (3, 2)
227
+ * ┌───┬─────────┐
228
+ * │ a │ atanh_a │
229
+ * ├───┼─────────┤
230
+ * │ 1 │ null │
231
+ * │ 2 │ null │
232
+ * │ 3 │ null │
233
+ * └───┴─────────┘
151
234
  */
152
235
  atanh(): this;
153
236
  /**
154
237
  * Computes the cube root of the column values.
155
238
  * @returns ColumnExpression
156
239
  * @example
157
- * >>> const df = $df.data({ a: [1, 8, 27] })
158
- * >>> df.with_columns($df.col("a").cbrt().alias("cbrt_a"))
240
+ * >>> const df = $df.data({ a: [1, 2, 3] })
241
+ * >>> df
242
+ * shape: (3, 1)
243
+ * ┌───┐
244
+ * │ a │
245
+ * ├───┤
246
+ * │ 1 │
247
+ * │ 2 │
248
+ * │ 3 │
249
+ * └───┘
250
+ * >>> df.withColumns($df.col("a").cbrt().alias("cbrt_a"))
159
251
  * shape: (3, 2)
160
- * ┌────┬────────┐
161
- * │ a │ cbrt_a
162
- * ├────┼────────┤
163
- * │ 1 │ 1
164
- * │ 8 2
165
- * │ 273
166
- * └────┴────────┘
252
+ * ┌───┬──────────┐
253
+ * │ a │ cbrt_a
254
+ * ├───┼──────────┤
255
+ * │ 1 │ 1
256
+ * │ 2 1.259921
257
+ * │ 31.44225
258
+ * └───┴──────────┘
167
259
  */
168
260
  cbrt(): this;
169
261
  /**
170
262
  * Rounds column values up to the nearest integer.
171
263
  * @returns ColumnExpression
172
264
  * @example
173
- * >>> const df = $df.data({ a: [1.1, 2.8, -0.5] })
174
- * >>> df.with_columns($df.col("a").ceil().alias("ceil_a"))
265
+ * >>> const df = $df.data({ a: [1, 2, 3] })
266
+ * >>> df
267
+ * shape: (3, 1)
268
+ * ┌───┐
269
+ * │ a │
270
+ * ├───┤
271
+ * │ 1 │
272
+ * │ 2 │
273
+ * │ 3 │
274
+ * └───┘
275
+ * >>> df.withColumns($df.col("a").ceil().alias("ceil_a"))
175
276
  * shape: (3, 2)
176
- * ┌──────┬────────┐
177
- * │ a │ ceil_a │
178
- * ├──────┼────────┤
179
- * │ 1.1 2
180
- * │ 2.8 3
181
- * │ -0.50
182
- * └──────┴────────┘
277
+ * ┌───┬────────┐
278
+ * │ a │ ceil_a │
279
+ * ├───┼────────┤
280
+ * │ 1 1
281
+ * │ 2 2
282
+ * │ 33
283
+ * └───┴────────┘
183
284
  */
184
285
  ceil(): this;
185
286
  /**
@@ -188,16 +289,25 @@ export declare class ArithmeticExpr extends ExprBase {
188
289
  * @param upper The upper threshold value (default: null).
189
290
  * @returns ColumnExpression
190
291
  * @example
191
- * >>> const df = $df.data({ a: [5, 15, 25] })
192
- * >>> df.with_columns($df.col("a").clip(10, 20).alias("clipped"))
292
+ * >>> const df = $df.data({ a: [1, 2, 3] })
293
+ * >>> df
294
+ * shape: (3, 1)
295
+ * ┌───┐
296
+ * │ a │
297
+ * ├───┤
298
+ * │ 1 │
299
+ * │ 2 │
300
+ * │ 3 │
301
+ * └───┘
302
+ * >>> df.withColumns($df.col("a").clip(2, 3).alias("clipped"))
193
303
  * shape: (3, 2)
194
- * ┌────┬─────────┐
195
- * │ a │ clipped │
196
- * ├────┼─────────┤
197
- * │ 5 10
198
- * │ 1515
199
- * │ 2520
200
- * └────┴─────────┘
304
+ * ┌───┬─────────┐
305
+ * │ a │ clipped │
306
+ * ├───┼─────────┤
307
+ * │ 1 2
308
+ * │ 22
309
+ * │ 33
310
+ * └───┴─────────┘
201
311
  */
202
312
  clip(lower?: number | null, upper?: number | null): this;
203
313
  /**
@@ -205,44 +315,74 @@ export declare class ArithmeticExpr extends ExprBase {
205
315
  * @param val The sign source value or column expression.
206
316
  * @returns ColumnExpression
207
317
  * @example
208
- * >>> const df = $df.data({ a: [5, 10], b: [-1, 1] })
209
- * >>> df.with_columns($df.col("a").copysign($df.col("b")).alias("signed"))
210
- * shape: (2, 3)
211
- * ┌────┬────┬────────┐
212
- * │ a │ b │ signed │
213
- * ├────┼────┼────────┤
214
- * │ 5 │ -1 │ -5
215
- * │ 101 │ 10
216
- * └────┴────┴────────┘
318
+ * >>> const df = $df.data({ a: [1, 2, 3], b: [10, 20, 30] })
319
+ * >>> df
320
+ * shape: (3, 2)
321
+ * ┌───┬────┐
322
+ * │ a │ b │
323
+ * ├───┼────┤
324
+ * │ 1 │ 10
325
+ * │ 220
326
+ * │ 3 │ 30 │
327
+ * └───┴────┘
328
+ * >>> df.withColumns($df.col("a").copysign($df.col("b")).alias("signed"))
329
+ * shape: (3, 3)
330
+ * ┌───┬────┬────────┐
331
+ * │ a │ b │ signed │
332
+ * ├───┼────┼────────┤
333
+ * │ 1 │ 10 │ 1 │
334
+ * │ 2 │ 20 │ 2 │
335
+ * │ 3 │ 30 │ 3 │
336
+ * └───┴────┴────────┘
217
337
  */
218
338
  copysign(val: NumericArg): this;
219
339
  /**
220
340
  * Computes the cosine of the column values.
221
341
  * @returns ColumnExpression
222
342
  * @example
223
- * >>> const df = $df.data({ a: [0, Math.PI] })
224
- * >>> df.with_columns($df.col("a").cos().alias("cos_a"))
225
- * shape: (2, 2)
226
- * ┌───────┬───────┐
227
- * │ a cos_a
228
- * ├───────┼───────┤
229
- * │ 0 │ 1
230
- * │ 3.141 -1 │
231
- * └───────┴───────┘
343
+ * >>> const df = $df.data({ a: [1, 2, 3] })
344
+ * >>> df
345
+ * shape: (3, 1)
346
+ * ┌───┐
347
+ * │ a │
348
+ * ├───┤
349
+ * │ 1
350
+ * │ 2
351
+ * │ 3 │
352
+ * └───┘
353
+ * >>> df.withColumns($df.col("a").cos().alias("cos_a"))
354
+ * shape: (3, 2)
355
+ * ┌───┬───────────┐
356
+ * │ a │ cos_a │
357
+ * ├───┼───────────┤
358
+ * │ 1 │ 0.540302 │
359
+ * │ 2 │ -0.416147 │
360
+ * │ 3 │ -0.989992 │
361
+ * └───┴───────────┘
232
362
  */
233
363
  cos(): this;
234
364
  /**
235
365
  * Computes the hyperbolic cosine of the column values.
236
366
  * @returns ColumnExpression
237
367
  * @example
238
- * >>> const df = $df.data({ a: [0, 1] })
239
- * >>> df.with_columns($df.col("a").cosh().alias("cosh_a"))
240
- * shape: (2, 2)
368
+ * >>> const df = $df.data({ a: [1, 2, 3] })
369
+ * >>> df
370
+ * shape: (3, 1)
371
+ * ┌───┐
372
+ * │ a │
373
+ * ├───┤
374
+ * │ 1 │
375
+ * │ 2 │
376
+ * │ 3 │
377
+ * └───┘
378
+ * >>> df.withColumns($df.col("a").cosh().alias("cosh_a"))
379
+ * shape: (3, 2)
241
380
  * ┌───┬───────────┐
242
381
  * │ a │ cosh_a │
243
382
  * ├───┼───────────┤
244
- * │ 0 │ 1
245
- * │ 11.543080
383
+ * │ 1 │ 1.543081
384
+ * │ 23.762196
385
+ * │ 3 │ 10.067662 │
246
386
  * └───┴───────────┘
247
387
  */
248
388
  cosh(): this;
@@ -250,15 +390,25 @@ export declare class ArithmeticExpr extends ExprBase {
250
390
  * Converts angles from radians to degrees.
251
391
  * @returns ColumnExpression
252
392
  * @example
253
- * >>> const df = $df.data({ a: [0, Math.PI] })
254
- * >>> df.with_columns($df.col("a").degrees().alias("deg"))
255
- * shape: (2, 2)
256
- * ┌───────┬─────┐
257
- * │ a deg
258
- * ├───────┼─────┤
259
- * │ 0 │ 0
260
- * │ 3.141 180 │
261
- * └───────┴─────┘
393
+ * >>> const df = $df.data({ a: [1, 2, 3] })
394
+ * >>> df
395
+ * shape: (3, 1)
396
+ * ┌───┐
397
+ * │ a │
398
+ * ├───┤
399
+ * │ 1
400
+ * │ 2
401
+ * │ 3 │
402
+ * └───┘
403
+ * >>> df.withColumns($df.col("a").degrees().alias("deg"))
404
+ * shape: (3, 2)
405
+ * ┌───┬────────────┐
406
+ * │ a │ deg │
407
+ * ├───┼────────────┤
408
+ * │ 1 │ 57.29578 │
409
+ * │ 2 │ 114.591559 │
410
+ * │ 3 │ 171.887339 │
411
+ * └───┴────────────┘
262
412
  */
263
413
  degrees(): this;
264
414
  /**
@@ -266,64 +416,100 @@ export declare class ArithmeticExpr extends ExprBase {
266
416
  * @param val The denominator value or column expression.
267
417
  * @returns ColumnExpression
268
418
  * @example
269
- * >>> const df = $df.data({ a: [10, 20, 30] })
270
- * >>> df.with_columns($df.col("a").div(2).alias("div_a"))
419
+ * >>> const df = $df.data({ a: [1, 2, 3] })
420
+ * >>> df
421
+ * shape: (3, 1)
422
+ * ┌───┐
423
+ * │ a │
424
+ * ├───┤
425
+ * │ 1 │
426
+ * │ 2 │
427
+ * │ 3 │
428
+ * └───┘
429
+ * >>> df.withColumns($df.col("a").div(2).alias("div_a"))
271
430
  * shape: (3, 2)
272
- * ┌────┬───────┐
273
- * │ a │ div_a │
274
- * ├────┼───────┤
275
- * │ 10 │ 5
276
- * │ 2010
277
- * │ 3015
278
- * └────┴───────┘
431
+ * ┌───┬───────┐
432
+ * │ a │ div_a │
433
+ * ├───┼───────┤
434
+ * │ 10.5
435
+ * │ 21
436
+ * │ 31.5
437
+ * └───┴───────┘
279
438
  */
280
439
  div(val: NumericArg): this;
281
440
  /**
282
441
  * Computes natural exponent (e^x) of the column values.
283
442
  * @returns ColumnExpression
284
443
  * @example
285
- * >>> const df = $df.data({ a: [0, 1, 2] })
286
- * >>> df.with_columns($df.col("a").exp().alias("exp_a"))
444
+ * >>> const df = $df.data({ a: [1, 2, 3] })
445
+ * >>> df
446
+ * shape: (3, 1)
447
+ * ┌───┐
448
+ * │ a │
449
+ * ├───┤
450
+ * │ 1 │
451
+ * │ 2 │
452
+ * │ 3 │
453
+ * └───┘
454
+ * >>> df.withColumns($df.col("a").exp().alias("exp_a"))
287
455
  * shape: (3, 2)
288
- * ┌───┬──────────┐
289
- * │ a │ exp_a
290
- * ├───┼──────────┤
291
- * │ 01
292
- * │ 12.718281
293
- * │ 27.389056
294
- * └───┴──────────┘
456
+ * ┌───┬───────────┐
457
+ * │ a │ exp_a
458
+ * ├───┼───────────┤
459
+ * │ 12.718282
460
+ * │ 27.389056
461
+ * │ 320.085537
462
+ * └───┴───────────┘
295
463
  */
296
464
  exp(): this;
297
465
  /**
298
466
  * Computes e^x - 1 for each element in the column.
299
467
  * @returns ColumnExpression
300
468
  * @example
301
- * >>> const df = $df.data({ a: [0, 1, 2] })
302
- * >>> df.with_columns($df.col("a").expm1().alias("expm1_a"))
469
+ * >>> const df = $df.data({ a: [1, 2, 3] })
470
+ * >>> df
471
+ * shape: (3, 1)
472
+ * ┌───┐
473
+ * │ a │
474
+ * ├───┤
475
+ * │ 1 │
476
+ * │ 2 │
477
+ * │ 3 │
478
+ * └───┘
479
+ * >>> df.withColumns($df.col("a").expm1().alias("expm1_a"))
303
480
  * shape: (3, 2)
304
- * ┌───┬──────────┐
305
- * │ a │ expm1_a
306
- * ├───┼──────────┤
307
- * │ 00
308
- * │ 11.718281
309
- * │ 26.389056
310
- * └───┴──────────┘
481
+ * ┌───┬───────────┐
482
+ * │ a │ expm1_a
483
+ * ├───┼───────────┤
484
+ * │ 11.718282
485
+ * │ 26.389056
486
+ * │ 319.085537
487
+ * └───┴───────────┘
311
488
  */
312
489
  expm1(): this;
313
490
  /**
314
491
  * Rounds column values down to the nearest integer.
315
492
  * @returns ColumnExpression
316
493
  * @example
317
- * >>> const df = $df.data({ a: [1.1, 2.8, -0.5] })
318
- * >>> df.with_columns($df.col("a").floor().alias("floor_a"))
494
+ * >>> const df = $df.data({ a: [1, 2, 3] })
495
+ * >>> df
496
+ * shape: (3, 1)
497
+ * ┌───┐
498
+ * │ a │
499
+ * ├───┤
500
+ * │ 1 │
501
+ * │ 2 │
502
+ * │ 3 │
503
+ * └───┘
504
+ * >>> df.withColumns($df.col("a").floor().alias("floor_a"))
319
505
  * shape: (3, 2)
320
- * ┌──────┬─────────┐
321
- * │ a │ floor_a │
322
- * ├──────┼─────────┤
323
- * │ 1.1 │ 1 │
324
- * │ 2.8 │ 2 │
325
- * │ -0.5-1
326
- * └──────┴─────────┘
506
+ * ┌───┬─────────┐
507
+ * │ a │ floor_a │
508
+ * ├───┼─────────┤
509
+ * │ 1 │ 1 │
510
+ * │ 2 │ 2 │
511
+ * │ 33
512
+ * └───┴─────────┘
327
513
  */
328
514
  floor(): this;
329
515
  /**
@@ -331,16 +517,25 @@ export declare class ArithmeticExpr extends ExprBase {
331
517
  * @param val The divisor value or column expression.
332
518
  * @returns ColumnExpression
333
519
  * @example
334
- * >>> const df = $df.data({ a: [5, 10, 15] })
335
- * >>> df.with_columns($df.col("a").floordiv(2).alias("fdiv"))
520
+ * >>> const df = $df.data({ a: [1, 2, 3] })
521
+ * >>> df
522
+ * shape: (3, 1)
523
+ * ┌───┐
524
+ * │ a │
525
+ * ├───┤
526
+ * │ 1 │
527
+ * │ 2 │
528
+ * │ 3 │
529
+ * └───┘
530
+ * >>> df.withColumns($df.col("a").floordiv(2).alias("fdiv"))
336
531
  * shape: (3, 2)
337
- * ┌────┬──────┐
338
- * │ a │ fdiv │
339
- * ├────┼──────┤
340
- * │ 5 2
341
- * │ 105
342
- * │ 157
343
- * └────┴──────┘
532
+ * ┌───┬──────┐
533
+ * │ a │ fdiv │
534
+ * ├───┼──────┤
535
+ * │ 1 0
536
+ * │ 21
537
+ * │ 31
538
+ * └───┴──────┘
344
539
  */
345
540
  floordiv(val: NumericArg): this;
346
541
  /**
@@ -348,15 +543,25 @@ export declare class ArithmeticExpr extends ExprBase {
348
543
  * @param val The other numeric value or column expression.
349
544
  * @returns ColumnExpression
350
545
  * @example
351
- * >>> const df = $df.data({ a: [3, 5], b: [4, 12] })
352
- * >>> df.with_columns($df.col("a").hypot($df.col("b")).alias("hypot_a"))
353
- * shape: (2, 3)
354
- * ┌───┬────┬─────────┐
355
- * │ a │ b │ hypot_a │
356
- * ├───┼────┼─────────┤
357
- * │ 34 │ 5
358
- * │ 512 13 │
359
- * └───┴────┴─────────┘
546
+ * >>> const df = $df.data({ a: [1, 2, 3], b: [10, 20, 30] })
547
+ * >>> df
548
+ * shape: (3, 2)
549
+ * ┌───┬────┐
550
+ * │ a │ b │
551
+ * ├───┼────┤
552
+ * │ 110
553
+ * │ 220
554
+ * │ 3 │ 30 │
555
+ * └───┴────┘
556
+ * >>> df.withColumns($df.col("a").hypot($df.col("b")).alias("hypot_a"))
557
+ * shape: (3, 3)
558
+ * ┌───┬────┬───────────┐
559
+ * │ a │ b │ hypot_a │
560
+ * ├───┼────┼───────────┤
561
+ * │ 1 │ 10 │ 10.049876 │
562
+ * │ 2 │ 20 │ 20.099751 │
563
+ * │ 3 │ 30 │ 30.149627 │
564
+ * └───┴────┴───────────┘
360
565
  */
361
566
  hypot(val: NumericArg): this;
362
567
  /**
@@ -364,31 +569,49 @@ export declare class ArithmeticExpr extends ExprBase {
364
569
  * @param base The base of the logarithm (default: Math.E).
365
570
  * @returns ColumnExpression
366
571
  * @example
367
- * >>> const df = $df.data({ a: [1, 10, 100] })
368
- * >>> df.with_columns($df.col("a").log(10).alias("log_a"))
572
+ * >>> const df = $df.data({ a: [1, 2, 3] })
573
+ * >>> df
574
+ * shape: (3, 1)
575
+ * ┌───┐
576
+ * │ a │
577
+ * ├───┤
578
+ * │ 1 │
579
+ * │ 2 │
580
+ * │ 3 │
581
+ * └───┘
582
+ * >>> df.withColumns($df.col("a").log(10).alias("log_a"))
369
583
  * shape: (3, 2)
370
- * ┌─────┬───────┐
371
- * │ a │ log_a
372
- * ├─────┼───────┤
373
- * │ 1 │ 0
374
- * │ 10 1
375
- * │ 1002
376
- * └─────┴───────┘
584
+ * ┌───┬──────────┐
585
+ * │ a │ log_a
586
+ * ├───┼──────────┤
587
+ * │ 1 │ 0
588
+ * │ 2 0.30103
589
+ * │ 30.477121
590
+ * └───┴──────────┘
377
591
  */
378
592
  log(base?: number): this;
379
593
  /**
380
594
  * Computes natural logarithm of 1 + x.
381
595
  * @returns ColumnExpression
382
596
  * @example
383
- * >>> const df = $df.data({ a: [0, 1, 2] })
384
- * >>> df.with_columns($df.col("a").log1p().alias("log1p_a"))
597
+ * >>> const df = $df.data({ a: [1, 2, 3] })
598
+ * >>> df
599
+ * shape: (3, 1)
600
+ * ┌───┐
601
+ * │ a │
602
+ * ├───┤
603
+ * │ 1 │
604
+ * │ 2 │
605
+ * │ 3 │
606
+ * └───┘
607
+ * >>> df.withColumns($df.col("a").log1p().alias("log1p_a"))
385
608
  * shape: (3, 2)
386
609
  * ┌───┬──────────┐
387
610
  * │ a │ log1p_a │
388
611
  * ├───┼──────────┤
389
- * │ 0 │ 0 │
390
612
  * │ 1 │ 0.693147 │
391
613
  * │ 2 │ 1.098612 │
614
+ * │ 3 │ 1.386294 │
392
615
  * └───┴──────────┘
393
616
  */
394
617
  log1p(): this;
@@ -397,16 +620,25 @@ export declare class ArithmeticExpr extends ExprBase {
397
620
  * @param val The divisor value or column expression.
398
621
  * @returns ColumnExpression
399
622
  * @example
400
- * >>> const df = $df.data({ a: [10, 11, 12] })
401
- * >>> df.with_columns($df.col("a").mod(2).alias("mod_a"))
623
+ * >>> const df = $df.data({ a: [1, 2, 3] })
624
+ * >>> df
625
+ * shape: (3, 1)
626
+ * ┌───┐
627
+ * │ a │
628
+ * ├───┤
629
+ * │ 1 │
630
+ * │ 2 │
631
+ * │ 3 │
632
+ * └───┘
633
+ * >>> df.withColumns($df.col("a").mod(2).alias("mod_a"))
402
634
  * shape: (3, 2)
403
- * ┌────┬───────┐
404
- * │ a │ mod_a │
405
- * ├────┼───────┤
406
- * │ 100
407
- * │ 111
408
- * │ 120
409
- * └────┴───────┘
635
+ * ┌───┬───────┐
636
+ * │ a │ mod_a │
637
+ * ├───┼───────┤
638
+ * │ 11
639
+ * │ 20
640
+ * │ 31
641
+ * └───┴───────┘
410
642
  */
411
643
  mod(val: NumericArg): this;
412
644
  /**
@@ -414,8 +646,17 @@ export declare class ArithmeticExpr extends ExprBase {
414
646
  * @param val The multiplier value or column expression.
415
647
  * @returns ColumnExpression
416
648
  * @example
417
- * >>> const df = $df.data({ a: [1, 2, 3] })
418
- * >>> df.with_columns($df.col("a").mul(5).alias("multiplied"))
649
+ * >>> const df = $df.data({ a: [1, 2, 3] })
650
+ * >>> df
651
+ * shape: (3, 1)
652
+ * ┌───┐
653
+ * │ a │
654
+ * ├───┤
655
+ * │ 1 │
656
+ * │ 2 │
657
+ * │ 3 │
658
+ * └───┘
659
+ * >>> df.withColumns($df.col("a").mul(5).alias("multiplied"))
419
660
  * shape: (3, 2)
420
661
  * ┌───┬────────────┐
421
662
  * │ a │ multiplied │
@@ -430,16 +671,25 @@ export declare class ArithmeticExpr extends ExprBase {
430
671
  * Negates column values (-x).
431
672
  * @returns ColumnExpression
432
673
  * @example
433
- * >>> const df = $df.data({ a: [1, -2, 3] })
434
- * >>> df.with_columns($df.col("a").negate().alias("negated"))
674
+ * >>> const df = $df.data({ a: [1, 2, 3] })
675
+ * >>> df
676
+ * shape: (3, 1)
677
+ * ┌───┐
678
+ * │ a │
679
+ * ├───┤
680
+ * │ 1 │
681
+ * │ 2 │
682
+ * │ 3 │
683
+ * └───┘
684
+ * >>> df.withColumns($df.col("a").negate().alias("negated"))
435
685
  * shape: (3, 2)
436
- * ┌────┬─────────┐
437
- * │ a │ negated │
438
- * ├────┼─────────┤
439
- * │ 1 │ -1 │
440
- * │ -2 │ 2
441
- * │ 3 │ -3 │
442
- * └────┴─────────┘
686
+ * ┌───┬─────────┐
687
+ * │ a │ negated │
688
+ * ├───┼─────────┤
689
+ * │ 1 │ -1 │
690
+ * │ 2 │ -2
691
+ * │ 3 │ -3 │
692
+ * └───┴─────────┘
443
693
  */
444
694
  negate(): this;
445
695
  /**
@@ -447,15 +697,24 @@ export declare class ArithmeticExpr extends ExprBase {
447
697
  * @param val The exponent power value or column expression.
448
698
  * @returns ColumnExpression
449
699
  * @example
450
- * >>> const df = $df.data({ a: [2, 3, 4] })
451
- * >>> df.with_columns($df.col("a").pow(2).alias("pow_a"))
700
+ * >>> const df = $df.data({ a: [1, 2, 3] })
701
+ * >>> df
702
+ * shape: (3, 1)
703
+ * ┌───┐
704
+ * │ a │
705
+ * ├───┤
706
+ * │ 1 │
707
+ * │ 2 │
708
+ * │ 3 │
709
+ * └───┘
710
+ * >>> df.withColumns($df.col("a").pow(2).alias("pow_a"))
452
711
  * shape: (3, 2)
453
712
  * ┌───┬───────┐
454
713
  * │ a │ pow_a │
455
714
  * ├───┼───────┤
715
+ * │ 1 │ 1 │
456
716
  * │ 2 │ 4 │
457
717
  * │ 3 │ 9 │
458
- * │ 4 │ 16 │
459
718
  * └───┴───────┘
460
719
  */
461
720
  pow(val: NumericArg): this;
@@ -463,15 +722,25 @@ export declare class ArithmeticExpr extends ExprBase {
463
722
  * Converts angles from degrees to radians.
464
723
  * @returns ColumnExpression
465
724
  * @example
466
- * >>> const df = $df.data({ a: [0, 180] })
467
- * >>> df.with_columns($df.col("a").radians().alias("rad"))
468
- * shape: (2, 2)
469
- * ┌─────┬──────────┐
470
- * │ a rad
471
- * ├─────┼──────────┤
472
- * │ 0 │ 0
473
- * │ 180 3.141592 │
474
- * └─────┴──────────┘
725
+ * >>> const df = $df.data({ a: [1, 2, 3] })
726
+ * >>> df
727
+ * shape: (3, 1)
728
+ * ┌───┐
729
+ * │ a │
730
+ * ├───┤
731
+ * │ 1
732
+ * │ 2
733
+ * │ 3 │
734
+ * └───┘
735
+ * >>> df.withColumns($df.col("a").radians().alias("rad"))
736
+ * shape: (3, 2)
737
+ * ┌───┬──────────┐
738
+ * │ a │ rad │
739
+ * ├───┼──────────┤
740
+ * │ 1 │ 0.017453 │
741
+ * │ 2 │ 0.034907 │
742
+ * │ 3 │ 0.05236 │
743
+ * └───┴──────────┘
475
744
  */
476
745
  radians(): this;
477
746
  /**
@@ -480,16 +749,25 @@ export declare class ArithmeticExpr extends ExprBase {
480
749
  * @param options Config options including min, max, and integer flag.
481
750
  * @returns ColumnExpression
482
751
  * @example
483
- * >>> const df = $df.data({ index: [1, 2, 3] })
484
- * >>> df.with_columns($df.col("index").rand(42, { min: 1, max: 10, integer: true }).alias("random"))
752
+ * >>> const df = $df.data({ a: [1, 2, 3] })
753
+ * >>> df
754
+ * shape: (3, 1)
755
+ * ┌───┐
756
+ * │ a │
757
+ * ├───┤
758
+ * │ 1 │
759
+ * │ 2 │
760
+ * │ 3 │
761
+ * └───┘
762
+ * >>> df.withColumns($df.col("a").rand(42, { min: 1, max: 10, integer: true }).alias("random"))
485
763
  * shape: (3, 2)
486
- * ┌───────┬────────┐
487
- * │ index │ random │
488
- * ├───────┼────────┤
489
- * │ 1 2
490
- * │ 2 5
491
- * │ 3 │ 6 │
492
- * └───────┴────────┘
764
+ * ┌───┬────────┐
765
+ * │ a │ random │
766
+ * ├───┼────────┤
767
+ * │ 1 7
768
+ * │ 2 8
769
+ * │ 3 │ 6 │
770
+ * └───┴────────┘
493
771
  */
494
772
  rand(seed?: number, { min, max, integer }?: RandomOptions): this;
495
773
  /**
@@ -497,76 +775,125 @@ export declare class ArithmeticExpr extends ExprBase {
497
775
  * @param decimals Number of decimal places to round to (default: 0).
498
776
  * @returns ColumnExpression
499
777
  * @example
500
- * >>> const df = $df.data({ a: [1.123, 2.789] })
501
- * >>> df.with_columns($df.col("a").round(2).alias("rounded"))
502
- * shape: (2, 2)
503
- * ┌───────┬─────────┐
504
- * │ a rounded
505
- * ├───────┼─────────┤
506
- * │ 1.123 1.12 │
507
- * │ 2.789 2.79 │
508
- * └───────┴─────────┘
778
+ * >>> const df = $df.data({ a: [1, 2, 3] })
779
+ * >>> df
780
+ * shape: (3, 1)
781
+ * ┌───┐
782
+ * │ a │
783
+ * ├───┤
784
+ * │ 1 │
785
+ * │ 2 │
786
+ * │ 3 │
787
+ * └───┘
788
+ * >>> df.withColumns($df.col("a").round(1).alias("rounded"))
789
+ * shape: (3, 2)
790
+ * ┌───┬─────────┐
791
+ * │ a │ rounded │
792
+ * ├───┼─────────┤
793
+ * │ 1 │ 1 │
794
+ * │ 2 │ 2 │
795
+ * │ 3 │ 3 │
796
+ * └───┴─────────┘
509
797
  */
510
798
  round(decimals?: number): this;
511
799
  /**
512
800
  * Rounds values to a specific number of significant figures.
513
- * @param sig_figs Number of significant figures.
801
+ * @param sigFigs Number of significant figures.
514
802
  * @returns ColumnExpression
515
803
  * @example
516
- * >>> const df = $df.data({ a: [123.45, 0.006789] })
517
- * >>> df.with_columns($df.col("a").round_sig_figs(3).alias("sig_figs"))
518
- * shape: (2, 2)
519
- * ┌──────────┬──────────┐
520
- * │ a sig_figs
521
- * ├──────────┼──────────┤
522
- * │ 123.45 │ 123
523
- * │ 0.006789 0.00679 │
524
- * └──────────┴──────────┘
804
+ * >>> const df = $df.data({ a: [1, 2, 3] })
805
+ * >>> df
806
+ * shape: (3, 1)
807
+ * ┌───┐
808
+ * │ a │
809
+ * ├───┤
810
+ * │ 1
811
+ * │ 2
812
+ * │ 3 │
813
+ * └───┘
814
+ * >>> df.withColumns($df.col("a").roundSigFigs(2).alias("sig_figs"))
815
+ * shape: (3, 2)
816
+ * ┌───┬──────────┐
817
+ * │ a │ sig_figs │
818
+ * ├───┼──────────┤
819
+ * │ 1 │ 1 │
820
+ * │ 2 │ 2 │
821
+ * │ 3 │ 3 │
822
+ * └───┴──────────┘
525
823
  */
526
- round_sig_figs(sig_figs: number): this;
824
+ roundSigFigs(sigFigs: number): this;
527
825
  /**
528
826
  * Returns sign indicator of column values (-1, 0, or 1).
529
827
  * @returns ColumnExpression
530
828
  * @example
531
- * >>> const df = $df.data({ a: [-10, 0, 50] })
532
- * >>> df.with_columns($df.col("a").sign().alias("sign_a"))
829
+ * >>> const df = $df.data({ a: [1, 2, 3] })
830
+ * >>> df
831
+ * shape: (3, 1)
832
+ * ┌───┐
833
+ * │ a │
834
+ * ├───┤
835
+ * │ 1 │
836
+ * │ 2 │
837
+ * │ 3 │
838
+ * └───┘
839
+ * >>> df.withColumns($df.col("a").sign().alias("sign_a"))
533
840
  * shape: (3, 2)
534
- * ┌─────┬────────┐
535
- * │ a │ sign_a │
536
- * ├─────┼────────┤
537
- * │ -10-1
538
- * │ 0 0
539
- * │ 50 │ 1 │
540
- * └─────┴────────┘
841
+ * ┌───┬────────┐
842
+ * │ a │ sign_a │
843
+ * ├───┼────────┤
844
+ * │ 1 │ 1
845
+ * │ 2 1
846
+ * │ 3 │ 1 │
847
+ * └───┴────────┘
541
848
  */
542
849
  sign(): this;
543
850
  /**
544
851
  * Computes the sine of the column values.
545
852
  * @returns ColumnExpression
546
853
  * @example
547
- * >>> const df = $df.data({ a: [0, Math.PI / 2] })
548
- * >>> df.with_columns($df.col("a").sin().alias("sin_a"))
549
- * shape: (2, 2)
550
- * ┌───────┬───────┐
551
- * │ a sin_a
552
- * ├───────┼───────┤
553
- * │ 0 │ 0
554
- * │ 1.570 1 │
555
- * └───────┴───────┘
854
+ * >>> const df = $df.data({ a: [1, 2, 3] })
855
+ * >>> df
856
+ * shape: (3, 1)
857
+ * ┌───┐
858
+ * │ a │
859
+ * ├───┤
860
+ * │ 1
861
+ * │ 2
862
+ * │ 3 │
863
+ * └───┘
864
+ * >>> df.withColumns($df.col("a").sin().alias("sin_a"))
865
+ * shape: (3, 2)
866
+ * ┌───┬──────────┐
867
+ * │ a │ sin_a │
868
+ * ├───┼──────────┤
869
+ * │ 1 │ 0.841471 │
870
+ * │ 2 │ 0.909297 │
871
+ * │ 3 │ 0.14112 │
872
+ * └───┴──────────┘
556
873
  */
557
874
  sin(): this;
558
875
  /**
559
876
  * Computes the hyperbolic sine of the column values.
560
877
  * @returns ColumnExpression
561
878
  * @example
562
- * >>> const df = $df.data({ a: [0, 1] })
563
- * >>> df.with_columns($df.col("a").sinh().alias("sinh_a"))
564
- * shape: (2, 2)
879
+ * >>> const df = $df.data({ a: [1, 2, 3] })
880
+ * >>> df
881
+ * shape: (3, 1)
882
+ * ┌───┐
883
+ * │ a │
884
+ * ├───┤
885
+ * │ 1 │
886
+ * │ 2 │
887
+ * │ 3 │
888
+ * └───┘
889
+ * >>> df.withColumns($df.col("a").sinh().alias("sinh_a"))
890
+ * shape: (3, 2)
565
891
  * ┌───┬───────────┐
566
892
  * │ a │ sinh_a │
567
893
  * ├───┼───────────┤
568
- * │ 0 │ 0 │
569
894
  * │ 1 │ 1.175201 │
895
+ * │ 2 │ 3.62686 │
896
+ * │ 3 │ 10.017875 │
570
897
  * └───┴───────────┘
571
898
  */
572
899
  sinh(): this;
@@ -574,16 +901,25 @@ export declare class ArithmeticExpr extends ExprBase {
574
901
  * Computes the square root of non-negative column values.
575
902
  * @returns ColumnExpression
576
903
  * @example
577
- * >>> const df = $df.data({ a: [4, 9, 16] })
578
- * >>> df.with_columns($df.col("a").sqrt().alias("sqrt_a"))
904
+ * >>> const df = $df.data({ a: [1, 2, 3] })
905
+ * >>> df
906
+ * shape: (3, 1)
907
+ * ┌───┐
908
+ * │ a │
909
+ * ├───┤
910
+ * │ 1 │
911
+ * │ 2 │
912
+ * │ 3 │
913
+ * └───┘
914
+ * >>> df.withColumns($df.col("a").sqrt().alias("sqrt_a"))
579
915
  * shape: (3, 2)
580
- * ┌────┬────────┐
581
- * │ a │ sqrt_a
582
- * ├────┼────────┤
583
- * │ 4 2
584
- * │ 9 3
585
- * │ 164
586
- * └────┴────────┘
916
+ * ┌───┬──────────┐
917
+ * │ a │ sqrt_a
918
+ * ├───┼──────────┤
919
+ * │ 1 1
920
+ * │ 2 1.414214
921
+ * │ 31.732051
922
+ * └───┴──────────┘
587
923
  */
588
924
  sqrt(): this;
589
925
  /**
@@ -591,62 +927,100 @@ export declare class ArithmeticExpr extends ExprBase {
591
927
  * @param val The value or column expression to subtract.
592
928
  * @returns ColumnExpression
593
929
  * @example
594
- * >>> const df = $df.data({ a: [10, 20, 30] })
595
- * >>> df.with_columns($df.col("a").sub(5).alias("sub_a"))
930
+ * >>> const df = $df.data({ a: [1, 2, 3] })
931
+ * >>> df
932
+ * shape: (3, 1)
933
+ * ┌───┐
934
+ * │ a │
935
+ * ├───┤
936
+ * │ 1 │
937
+ * │ 2 │
938
+ * │ 3 │
939
+ * └───┘
940
+ * >>> df.withColumns($df.col("a").sub(5).alias("sub_a"))
596
941
  * shape: (3, 2)
597
- * ┌────┬───────┐
598
- * │ a │ sub_a │
599
- * ├────┼───────┤
600
- * │ 105
601
- * │ 2015
602
- * │ 3025
603
- * └────┴───────┘
942
+ * ┌───┬───────┐
943
+ * │ a │ sub_a │
944
+ * ├───┼───────┤
945
+ * │ 1-4
946
+ * │ 2-3
947
+ * │ 3-2
948
+ * └───┴───────┘
604
949
  */
605
950
  sub(val: NumericArg): this;
606
951
  /**
607
952
  * Computes the tangent of the column values.
608
953
  * @returns ColumnExpression
609
954
  * @example
610
- * >>> const df = $df.data({ a: [0, Math.PI / 4] })
611
- * >>> df.with_columns($df.col("a").tan().alias("tan_a"))
612
- * shape: (2, 2)
613
- * ┌───────┬───────┐
614
- * │ a tan_a
615
- * ├───────┼───────┤
616
- * │ 0 │ 0
617
- * │ 0.785 1 │
618
- * └───────┴───────┘
955
+ * >>> const df = $df.data({ a: [1, 2, 3] })
956
+ * >>> df
957
+ * shape: (3, 1)
958
+ * ┌───┐
959
+ * │ a │
960
+ * ├───┤
961
+ * │ 1
962
+ * │ 2
963
+ * │ 3 │
964
+ * └───┘
965
+ * >>> df.withColumns($df.col("a").tan().alias("tan_a"))
966
+ * shape: (3, 2)
967
+ * ┌───┬───────────┐
968
+ * │ a │ tan_a │
969
+ * ├───┼───────────┤
970
+ * │ 1 │ 1.557408 │
971
+ * │ 2 │ -2.18504 │
972
+ * │ 3 │ -0.142547 │
973
+ * └───┴───────────┘
619
974
  */
620
975
  tan(): this;
621
976
  /**
622
977
  * Computes the hyperbolic tangent of the column values.
623
978
  * @returns ColumnExpression
624
979
  * @example
625
- * >>> const df = $df.data({ a: [0, 1] })
626
- * >>> df.with_columns($df.col("a").tanh().alias("tanh_a"))
627
- * shape: (2, 2)
628
- * ┌───┬───────────┐
629
- * │ a │ tanh_a │
630
- * ├───┼───────────┤
631
- * │ 0 0 │
632
- * │ 1 0.761594 │
633
- * └───┴───────────┘
980
+ * >>> const df = $df.data({ a: [1, 2, 3] })
981
+ * >>> df
982
+ * shape: (3, 1)
983
+ * ┌───┐
984
+ * │ a │
985
+ * ├───┤
986
+ * │ 1
987
+ * │ 2
988
+ * │ 3 │
989
+ * └───┘
990
+ * >>> df.withColumns($df.col("a").tanh().alias("tanh_a"))
991
+ * shape: (3, 2)
992
+ * ┌───┬──────────┐
993
+ * │ a │ tanh_a │
994
+ * ├───┼──────────┤
995
+ * │ 1 │ 0.761594 │
996
+ * │ 2 │ 0.964028 │
997
+ * │ 3 │ 0.995055 │
998
+ * └───┴──────────┘
634
999
  */
635
1000
  tanh(): this;
636
1001
  /**
637
1002
  * Truncates fractional digits of column values.
638
1003
  * @returns ColumnExpression
639
1004
  * @example
640
- * >>> const df = $df.data({ a: [1.1, 2.9, -3.5] })
641
- * >>> df.with_columns($df.col("a").trunc().alias("trunc_a"))
1005
+ * >>> const df = $df.data({ a: [1, 2, 3] })
1006
+ * >>> df
1007
+ * shape: (3, 1)
1008
+ * ┌───┐
1009
+ * │ a │
1010
+ * ├───┤
1011
+ * │ 1 │
1012
+ * │ 2 │
1013
+ * │ 3 │
1014
+ * └───┘
1015
+ * >>> df.withColumns($df.col("a").trunc().alias("trunc_a"))
642
1016
  * shape: (3, 2)
643
- * ┌──────┬─────────┐
644
- * │ a │ trunc_a │
645
- * ├──────┼─────────┤
646
- * │ 1.1 │ 1 │
647
- * │ 2.9 │ 2 │
648
- * │ -3.5-3
649
- * └──────┴─────────┘
1017
+ * ┌───┬─────────┐
1018
+ * │ a │ trunc_a │
1019
+ * ├───┼─────────┤
1020
+ * │ 1 │ 1 │
1021
+ * │ 2 │ 2 │
1022
+ * │ 3 │ 3
1023
+ * └───┴─────────┘
650
1024
  */
651
1025
  trunc(): this;
652
1026
  }