df-script 1.5.0 → 1.7.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.
- package/README.md +125 -9
- package/dist/api.d.ts +3 -2
- package/dist/assets/index-DBhGK6Tp.css +1 -0
- package/dist/assets/index-DEJEV_tU.js +195 -0
- package/dist/columnExpressions/ColumnExpr.d.ts +14 -7
- package/dist/columnExpressions/ExprBase.d.ts +26 -12
- package/dist/columnExpressions/constants.d.ts +1 -0
- package/dist/columnExpressions/functions/all.d.ts +23 -0
- package/dist/columnExpressions/functions/coalesce.d.ts +31 -2
- package/dist/columnExpressions/functions/element.d.ts +26 -1
- package/dist/columnExpressions/functions/exclude.d.ts +24 -0
- package/dist/columnExpressions/functions/implode.d.ts +28 -0
- package/dist/columnExpressions/functions/lit.d.ts +27 -0
- package/dist/columnExpressions/functions/seq_range.d.ts +36 -0
- package/dist/columnExpressions/functions/struct.d.ts +31 -0
- package/dist/columnExpressions/functions/when.d.ts +38 -8
- package/dist/columnExpressions/index.d.ts +2 -1
- package/dist/columnExpressions/mixins/AggregationExpr.d.ts +336 -2
- package/dist/columnExpressions/mixins/ArithmeticExpr.d.ts +620 -10
- package/dist/columnExpressions/mixins/ArrayExpr.d.ts +567 -0
- package/dist/columnExpressions/mixins/ComparisonExpr.d.ts +353 -0
- package/dist/columnExpressions/mixins/LogicalExpr.d.ts +82 -0
- package/dist/columnExpressions/mixins/ManipulationExpr.d.ts +40 -0
- package/dist/columnExpressions/mixins/StringExpr.d.ts +658 -5
- package/dist/columnExpressions/mixins/StructExpr.d.ts +70 -0
- package/dist/columnExpressions/mixins/TemporalExpr.d.ts +530 -4
- package/dist/columnExpressions/mixins/WindowExpr.d.ts +313 -2
- package/dist/columnExpressions/types.d.ts +2 -0
- package/dist/constants.d.ts +11 -0
- package/dist/dataframe/dataframe.d.ts +933 -3
- package/dist/dataframe/grouped/grouped.d.ts +41 -6
- package/dist/dataframe/types.d.ts +1 -0
- package/dist/dataframe/utils.d.ts +1 -0
- package/dist/datatypes/index.d.ts +3 -2
- package/dist/datatypes/types.d.ts +52 -7
- package/dist/exceptions/index.d.ts +23 -0
- package/dist/functions/concat.d.ts +50 -0
- package/dist/functions/read_csv.d.ts +9 -0
- package/dist/functions/read_json.d.ts +7 -2
- package/dist/index.html +17 -0
- package/dist/index.js +6 -6
- package/dist/index.mjs +6 -0
- package/dist/types.d.ts +51 -16
- package/dist/utils/{list.d.ts → array.d.ts} +68 -15
- package/dist/utils/binary.d.ts +3 -0
- package/dist/utils/csv.d.ts +1 -0
- package/dist/utils/date.d.ts +23 -54
- package/dist/utils/index.d.ts +3 -2
- package/dist/utils/json.d.ts +1 -0
- package/dist/utils/number.d.ts +15 -29
- package/dist/utils/object.d.ts +27 -0
- package/dist/utils/string.d.ts +15 -5
- package/package.json +18 -4
- package/dist/api.js +0 -26
- package/dist/bundle.min.js +0 -1
- package/dist/columnExpressions/ColumnExpr.js +0 -219
- package/dist/columnExpressions/ExprBase.js +0 -92
- package/dist/columnExpressions/constants.js +0 -7
- package/dist/columnExpressions/functions/all.js +0 -11
- package/dist/columnExpressions/functions/coalesce.js +0 -44
- package/dist/columnExpressions/functions/element.js +0 -11
- package/dist/columnExpressions/functions/exclude.js +0 -13
- package/dist/columnExpressions/functions/implode.js +0 -7
- package/dist/columnExpressions/functions/lit.js +0 -17
- package/dist/columnExpressions/functions/repeat.d.ts +0 -47
- package/dist/columnExpressions/functions/repeat.js +0 -131
- package/dist/columnExpressions/functions/seq_range.js +0 -91
- package/dist/columnExpressions/functions/when.js +0 -85
- package/dist/columnExpressions/index.js +0 -38
- package/dist/columnExpressions/mixins/AggregationExpr.js +0 -76
- package/dist/columnExpressions/mixins/ArithmeticExpr.js +0 -131
- package/dist/columnExpressions/mixins/BooleanExpr.d.ts +0 -40
- package/dist/columnExpressions/mixins/BooleanExpr.js +0 -67
- package/dist/columnExpressions/mixins/ComparisonExpr.js +0 -250
- package/dist/columnExpressions/mixins/ListExpr.d.ts +0 -39
- package/dist/columnExpressions/mixins/ListExpr.js +0 -224
- package/dist/columnExpressions/mixins/LogicalExpr.js +0 -53
- package/dist/columnExpressions/mixins/ManipulationExpr.js +0 -71
- package/dist/columnExpressions/mixins/NumericExpr.d.ts +0 -92
- package/dist/columnExpressions/mixins/NumericExpr.js +0 -259
- package/dist/columnExpressions/mixins/StringExpr.js +0 -237
- package/dist/columnExpressions/mixins/StructExpr.js +0 -139
- package/dist/columnExpressions/mixins/TemporalExpr.js +0 -126
- package/dist/columnExpressions/mixins/WindowExpr.js +0 -151
- package/dist/columnExpressions/types.js +0 -2
- package/dist/columnExpressions/utils.js +0 -45
- package/dist/dataframe/constants.js +0 -7
- package/dist/dataframe/dataframe.js +0 -990
- package/dist/dataframe/grouped/grouped.js +0 -114
- package/dist/dataframe/index.js +0 -20
- package/dist/dataframe/types.js +0 -2
- package/dist/dataframe/utils.js +0 -307
- package/dist/datatypes/DataType.js +0 -76
- package/dist/datatypes/index.js +0 -46
- package/dist/datatypes/types/Binary.d.ts +0 -9
- package/dist/datatypes/types/Binary.js +0 -18
- package/dist/datatypes/types/Boolean.d.ts +0 -9
- package/dist/datatypes/types/Boolean.js +0 -19
- package/dist/datatypes/types/Date.d.ts +0 -8
- package/dist/datatypes/types/Date.js +0 -21
- package/dist/datatypes/types/Datetime.d.ts +0 -8
- package/dist/datatypes/types/Datetime.js +0 -17
- package/dist/datatypes/types/Decimal.d.ts +0 -10
- package/dist/datatypes/types/Decimal.js +0 -28
- package/dist/datatypes/types/Duration.d.ts +0 -8
- package/dist/datatypes/types/Duration.js +0 -17
- package/dist/datatypes/types/Float32.d.ts +0 -8
- package/dist/datatypes/types/Float32.js +0 -17
- package/dist/datatypes/types/Float64.d.ts +0 -8
- package/dist/datatypes/types/Float64.js +0 -17
- package/dist/datatypes/types/Int16.d.ts +0 -8
- package/dist/datatypes/types/Int16.js +0 -17
- package/dist/datatypes/types/Int32.d.ts +0 -8
- package/dist/datatypes/types/Int32.js +0 -17
- package/dist/datatypes/types/Int64.d.ts +0 -8
- package/dist/datatypes/types/Int64.js +0 -17
- package/dist/datatypes/types/Int8.d.ts +0 -8
- package/dist/datatypes/types/Int8.js +0 -17
- package/dist/datatypes/types/List.d.ts +0 -10
- package/dist/datatypes/types/List.js +0 -31
- package/dist/datatypes/types/Null.d.ts +0 -9
- package/dist/datatypes/types/Null.js +0 -17
- package/dist/datatypes/types/Object.d.ts +0 -9
- package/dist/datatypes/types/Object.js +0 -17
- package/dist/datatypes/types/Struct.d.ts +0 -14
- package/dist/datatypes/types/Struct.js +0 -39
- package/dist/datatypes/types/Time.d.ts +0 -8
- package/dist/datatypes/types/Time.js +0 -29
- package/dist/datatypes/types/UInt16.d.ts +0 -8
- package/dist/datatypes/types/UInt16.js +0 -17
- package/dist/datatypes/types/UInt32.d.ts +0 -8
- package/dist/datatypes/types/UInt32.js +0 -17
- package/dist/datatypes/types/UInt64.d.ts +0 -8
- package/dist/datatypes/types/UInt64.js +0 -17
- package/dist/datatypes/types/UInt8.d.ts +0 -8
- package/dist/datatypes/types/UInt8.js +0 -17
- package/dist/datatypes/types/Utf8.d.ts +0 -10
- package/dist/datatypes/types/Utf8.js +0 -20
- package/dist/datatypes/types.js +0 -290
- package/dist/exceptions/index.js +0 -46
- package/dist/exceptions/utils.js +0 -28
- package/dist/functions/concat.js +0 -260
- package/dist/functions/index.js +0 -9
- package/dist/functions/read_csv.js +0 -53
- package/dist/functions/read_json.js +0 -21
- package/dist/functions/transpose.d.ts +0 -7
- package/dist/functions/transpose.js +0 -84
- package/dist/types.js +0 -2
- package/dist/utils/boolean.d.ts +0 -1
- package/dist/utils/boolean.js +0 -18
- package/dist/utils/csv.js +0 -313
- package/dist/utils/date.js +0 -348
- package/dist/utils/guards.d.ts +0 -12
- package/dist/utils/guards.js +0 -112
- package/dist/utils/index.js +0 -23
- package/dist/utils/json.js +0 -217
- package/dist/utils/list.js +0 -361
- package/dist/utils/number.js +0 -401
- package/dist/utils/string.js +0 -209
|
@@ -1,28 +1,339 @@
|
|
|
1
1
|
import type { IExpr } from "../../types";
|
|
2
2
|
import { ExprBase } from "../ExprBase";
|
|
3
|
+
/**
|
|
4
|
+
* @namespace $df.col
|
|
5
|
+
* @category ColumnExpression
|
|
6
|
+
* @syntax $df.col(<column_name>).{symbol}(...)
|
|
7
|
+
*/
|
|
3
8
|
export declare class WindowExpr extends ExprBase {
|
|
4
|
-
|
|
9
|
+
_partitionBy: (string | IExpr)[] | null;
|
|
5
10
|
_window(evaluateWindow: (this: IExpr, groupPreValues: any[], partitionIndices: number[], currentIndex: number) => any): this;
|
|
6
11
|
_rolling(windowSize: number, aggFn: (vals: any[]) => any): this;
|
|
7
12
|
_cum(reverse: boolean, initialVal: any, stepFn: (acc: any, val: any) => any, postFn?: (acc: any, hasValid: boolean) => any): this;
|
|
8
|
-
get
|
|
13
|
+
get _isWindow(): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Window: Computes cumulative count.
|
|
16
|
+
* @param reverse Flag indicating whether to compute from reverse direction.
|
|
17
|
+
* @returns ColumnExpression
|
|
18
|
+
* @example
|
|
19
|
+
* >>> const df = $df.data({ val: [10, 20, 30] })
|
|
20
|
+
* >>> df.with_columns($df.col("val").cum_count().alias("c_count"))
|
|
21
|
+
* shape: (3, 2)
|
|
22
|
+
* ┌─────┬─────────┐
|
|
23
|
+
* │ val │ c_count │
|
|
24
|
+
* ├─────┼─────────┤
|
|
25
|
+
* │ 10 │ 1 │
|
|
26
|
+
* │ 20 │ 2 │
|
|
27
|
+
* │ 30 │ 3 │
|
|
28
|
+
* └─────┴─────────┘
|
|
29
|
+
*/
|
|
9
30
|
cum_count(reverse?: boolean): this;
|
|
31
|
+
/**
|
|
32
|
+
* Window: Computes cumulative maximum value.
|
|
33
|
+
* @param reverse Flag indicating whether to compute in reverse direction.
|
|
34
|
+
* @returns ColumnExpression
|
|
35
|
+
* @example
|
|
36
|
+
* >>> const df = $df.data({ val: [1, 3, 2] })
|
|
37
|
+
* >>> df.with_columns($df.col("val").cum_max().alias("c_max"))
|
|
38
|
+
* shape: (3, 2)
|
|
39
|
+
* ┌─────┬───────┐
|
|
40
|
+
* │ val │ c_max │
|
|
41
|
+
* ├─────┼───────┤
|
|
42
|
+
* │ 1 │ 1 │
|
|
43
|
+
* │ 3 │ 3 │
|
|
44
|
+
* │ 2 │ 3 │
|
|
45
|
+
* └─────┴───────┘
|
|
46
|
+
*/
|
|
10
47
|
cum_max(reverse?: boolean): this;
|
|
48
|
+
/**
|
|
49
|
+
* Window: Computes cumulative minimum value.
|
|
50
|
+
* @param reverse Flag indicating whether to compute in reverse direction.
|
|
51
|
+
* @returns ColumnExpression
|
|
52
|
+
* @example
|
|
53
|
+
* >>> const df = $df.data({ val: [3, 1, 2] })
|
|
54
|
+
* >>> df.with_columns($df.col("val").cum_min().alias("c_min"))
|
|
55
|
+
* shape: (3, 2)
|
|
56
|
+
* ┌─────┬───────┐
|
|
57
|
+
* │ val │ c_min │
|
|
58
|
+
* ├─────┼───────┤
|
|
59
|
+
* │ 3 │ 3 │
|
|
60
|
+
* │ 1 │ 1 │
|
|
61
|
+
* │ 2 │ 1 │
|
|
62
|
+
* └─────┴───────┘
|
|
63
|
+
*/
|
|
11
64
|
cum_min(reverse?: boolean): this;
|
|
65
|
+
/**
|
|
66
|
+
* Window: Computes cumulative product of values.
|
|
67
|
+
* @param reverse Flag indicating whether to compute in reverse direction.
|
|
68
|
+
* @returns ColumnExpression
|
|
69
|
+
* @example
|
|
70
|
+
* >>> const df = $df.data({ val: [1, 2, 3, 4] })
|
|
71
|
+
* >>> df.with_columns($df.col("val").cum_prod().alias("c_prod"))
|
|
72
|
+
* shape: (4, 2)
|
|
73
|
+
* ┌─────┬────────┐
|
|
74
|
+
* │ val │ c_prod │
|
|
75
|
+
* ├─────┼────────┤
|
|
76
|
+
* │ 1 │ 1 │
|
|
77
|
+
* │ 2 │ 2 │
|
|
78
|
+
* │ 3 │ 6 │
|
|
79
|
+
* │ 4 │ 24 │
|
|
80
|
+
* └─────┴────────┘
|
|
81
|
+
*/
|
|
12
82
|
cum_prod(reverse?: boolean): this;
|
|
83
|
+
/**
|
|
84
|
+
* Window: Computes cumulative sum of values.
|
|
85
|
+
* @param reverse Flag indicating whether to compute in reverse direction.
|
|
86
|
+
* @returns ColumnExpression
|
|
87
|
+
* @example
|
|
88
|
+
* >>> const df = $df.data({ val: [10, 20, 30] })
|
|
89
|
+
* >>> df.with_columns($df.col("val").cum_sum().alias("c_sum"))
|
|
90
|
+
* shape: (3, 2)
|
|
91
|
+
* ┌─────┬───────┐
|
|
92
|
+
* │ val │ c_sum │
|
|
93
|
+
* ├─────┼───────┤
|
|
94
|
+
* │ 10 │ 10 │
|
|
95
|
+
* │ 20 │ 30 │
|
|
96
|
+
* │ 30 │ 60 │
|
|
97
|
+
* └─────┴───────┘
|
|
98
|
+
*/
|
|
13
99
|
cum_sum(reverse?: boolean): this;
|
|
100
|
+
/**
|
|
101
|
+
* Window: Computes dense rank (ranks without gaps) within group partition.
|
|
102
|
+
* @returns ColumnExpression
|
|
103
|
+
* @example
|
|
104
|
+
* >>> const df = $df.data({ score: [100, 100, 90] })
|
|
105
|
+
* >>> df.with_columns($df.col("score").dense_rank().alias("dr"))
|
|
106
|
+
* shape: (3, 2)
|
|
107
|
+
* ┌───────┬────┐
|
|
108
|
+
* │ score │ dr │
|
|
109
|
+
* ├───────┼────┤
|
|
110
|
+
* │ 100 │ 2 │
|
|
111
|
+
* │ 100 │ 2 │
|
|
112
|
+
* │ 90 │ 1 │
|
|
113
|
+
* └───────┴────┘
|
|
114
|
+
*/
|
|
14
115
|
dense_rank(): this;
|
|
116
|
+
/**
|
|
117
|
+
* Window: Shifts values down by offset, filling missing slots with default value.
|
|
118
|
+
* @param offset Number of rows to shift down (default 1).
|
|
119
|
+
* @param defaultVal Fallback fill value for empty slots (default null).
|
|
120
|
+
* @returns ColumnExpression
|
|
121
|
+
* @example
|
|
122
|
+
* >>> const df = $df.data({ val: [10, 20, 30] })
|
|
123
|
+
* >>> df.with_columns($df.col("val").lag(1, 0).alias("prev"))
|
|
124
|
+
* shape: (3, 2)
|
|
125
|
+
* ┌─────┬──────┐
|
|
126
|
+
* │ val │ prev │
|
|
127
|
+
* ├─────┼──────┤
|
|
128
|
+
* │ 10 │ 0 │
|
|
129
|
+
* │ 20 │ 10 │
|
|
130
|
+
* │ 30 │ 20 │
|
|
131
|
+
* └─────┴──────┘
|
|
132
|
+
*/
|
|
15
133
|
lag(offset?: number, defaultVal?: any): this;
|
|
134
|
+
/**
|
|
135
|
+
* Window: Shifts values up by offset, filling missing slots with default value.
|
|
136
|
+
* @param offset Number of rows to shift up (default 1).
|
|
137
|
+
* @param defaultVal Fallback fill value for empty slots (default null).
|
|
138
|
+
* @returns ColumnExpression
|
|
139
|
+
* @example
|
|
140
|
+
* >>> const df = $df.data({ val: [10, 20, 30] })
|
|
141
|
+
* >>> df.with_columns($df.col("val").lead(1, 0).alias("next"))
|
|
142
|
+
* shape: (3, 2)
|
|
143
|
+
* ┌─────┬──────┐
|
|
144
|
+
* │ val │ next │
|
|
145
|
+
* ├─────┼──────┤
|
|
146
|
+
* │ 10 │ 20 │
|
|
147
|
+
* │ 20 │ 30 │
|
|
148
|
+
* │ 30 │ 0 │
|
|
149
|
+
* └─────┴──────┘
|
|
150
|
+
*/
|
|
16
151
|
lead(offset?: number, defaultVal?: any): this;
|
|
152
|
+
/**
|
|
153
|
+
* Executes a window aggregation partitioned by column keys.
|
|
154
|
+
* @param columns Column expression or array of columns to partition by.
|
|
155
|
+
* @returns ColumnExpression
|
|
156
|
+
* @example
|
|
157
|
+
* >>> const df = $df.data({ cat: ["A", "A", "B"], val: [10, 20, 30] })
|
|
158
|
+
* >>> df.with_columns($df.col("val").sum().over("cat").alias("cat_sum"))
|
|
159
|
+
* shape: (3, 3)
|
|
160
|
+
* ┌─────┬─────┬─────────┐
|
|
161
|
+
* │ cat │ val │ cat_sum │
|
|
162
|
+
* ├─────┼─────┼─────────┤
|
|
163
|
+
* │ A │ 10 │ 30 │
|
|
164
|
+
* │ A │ 20 │ 30 │
|
|
165
|
+
* │ B │ 30 │ 30 │
|
|
166
|
+
* └─────┴─────┴─────────┘
|
|
167
|
+
*/
|
|
17
168
|
over(columns: string | IExpr | (string | IExpr)[]): this;
|
|
169
|
+
/**
|
|
170
|
+
* Window: Computes rank within group partition.
|
|
171
|
+
* @returns ColumnExpression
|
|
172
|
+
* @example
|
|
173
|
+
* >>> const df = $df.data({ score: [100, 80, 90] })
|
|
174
|
+
* >>> df.with_columns($df.col("score").rank().alias("rank"))
|
|
175
|
+
* shape: (3, 2)
|
|
176
|
+
* ┌───────┬──────┐
|
|
177
|
+
* │ score │ rank │
|
|
178
|
+
* ├───────┼──────┤
|
|
179
|
+
* │ 100 │ 3 │
|
|
180
|
+
* │ 80 │ 1 │
|
|
181
|
+
* │ 90 │ 2 │
|
|
182
|
+
* └───────┴──────┘
|
|
183
|
+
*/
|
|
18
184
|
rank(): this;
|
|
185
|
+
/**
|
|
186
|
+
* Window: Computes rolling window maximum value.
|
|
187
|
+
* @param windowSize Size of rolling window.
|
|
188
|
+
* @returns ColumnExpression
|
|
189
|
+
* @example
|
|
190
|
+
* >>> const df = $df.data({ val: [1, 5, 2, 8] })
|
|
191
|
+
* >>> df.with_columns($df.col("val").rolling_max(2).alias("r_max"))
|
|
192
|
+
* shape: (4, 2)
|
|
193
|
+
* ┌─────┬───────┐
|
|
194
|
+
* │ val │ r_max │
|
|
195
|
+
* ├─────┼───────┤
|
|
196
|
+
* │ 1 │ 1 │
|
|
197
|
+
* │ 5 │ 5 │
|
|
198
|
+
* │ 2 │ 5 │
|
|
199
|
+
* │ 8 │ 8 │
|
|
200
|
+
* └─────┴───────┘
|
|
201
|
+
*/
|
|
19
202
|
rolling_max(windowSize: number): this;
|
|
203
|
+
/**
|
|
204
|
+
* Window: Computes rolling window mean average.
|
|
205
|
+
* @param windowSize Size of rolling window.
|
|
206
|
+
* @returns ColumnExpression
|
|
207
|
+
* @example
|
|
208
|
+
* >>> const df = $df.data({ val: [10, 20, 30] })
|
|
209
|
+
* >>> df.with_columns($df.col("val").rolling_mean(2).alias("r_mean"))
|
|
210
|
+
* shape: (3, 2)
|
|
211
|
+
* ┌─────┬────────┐
|
|
212
|
+
* │ val │ r_mean │
|
|
213
|
+
* ├─────┼────────┤
|
|
214
|
+
* │ 10 │ 10 │
|
|
215
|
+
* │ 20 │ 15 │
|
|
216
|
+
* │ 30 │ 25 │
|
|
217
|
+
* └─────┴────────┘
|
|
218
|
+
*/
|
|
20
219
|
rolling_mean(windowSize: number): this;
|
|
220
|
+
/**
|
|
221
|
+
* Window: Computes rolling window median value.
|
|
222
|
+
* @param windowSize Size of rolling window.
|
|
223
|
+
* @returns ColumnExpression
|
|
224
|
+
* @example
|
|
225
|
+
* >>> const df = $df.data({ val: [10, 30, 20] })
|
|
226
|
+
* >>> df.with_columns($df.col("val").rolling_median(2).alias("r_med"))
|
|
227
|
+
* shape: (3, 2)
|
|
228
|
+
* ┌─────┬───────┐
|
|
229
|
+
* │ val │ r_med │
|
|
230
|
+
* ├─────┼───────┤
|
|
231
|
+
* │ 10 │ 10 │
|
|
232
|
+
* │ 30 │ 20 │
|
|
233
|
+
* │ 20 │ 25 │
|
|
234
|
+
* └─────┴───────┘
|
|
235
|
+
*/
|
|
21
236
|
rolling_median(windowSize: number): this;
|
|
237
|
+
/**
|
|
238
|
+
* Window: Computes rolling window minimum value.
|
|
239
|
+
* @param windowSize Size of rolling window.
|
|
240
|
+
* @returns ColumnExpression
|
|
241
|
+
* @example
|
|
242
|
+
* >>> const df = $df.data({ val: [10, 5, 20] })
|
|
243
|
+
* >>> df.with_columns($df.col("val").rolling_min(2).alias("r_min"))
|
|
244
|
+
* shape: (3, 2)
|
|
245
|
+
* ┌─────┬───────┐
|
|
246
|
+
* │ val │ r_min │
|
|
247
|
+
* ├─────┼───────┤
|
|
248
|
+
* │ 10 │ 10 │
|
|
249
|
+
* │ 5 │ 5 │
|
|
250
|
+
* │ 20 │ 5 │
|
|
251
|
+
* └─────┴───────┘
|
|
252
|
+
*/
|
|
22
253
|
rolling_min(windowSize: number): this;
|
|
254
|
+
/**
|
|
255
|
+
* Window: Computes rolling window quantile value.
|
|
256
|
+
* @param quantile Quantile boundary between 0.0 and 1.0.
|
|
257
|
+
* @param windowSize Size of rolling window.
|
|
258
|
+
* @returns ColumnExpression
|
|
259
|
+
* @example
|
|
260
|
+
* >>> const df = $df.data({ val: [10, 20, 30] })
|
|
261
|
+
* >>> df.with_columns($df.col("val").rolling_quantile(0.5, 2).alias("r_quant"))
|
|
262
|
+
* shape: (3, 2)
|
|
263
|
+
* ┌─────┬─────────┐
|
|
264
|
+
* │ val │ r_quant │
|
|
265
|
+
* ├─────┼─────────┤
|
|
266
|
+
* │ 10 │ 10 │
|
|
267
|
+
* │ 20 │ 15 │
|
|
268
|
+
* │ 30 │ 25 │
|
|
269
|
+
* └─────┴─────────┘
|
|
270
|
+
*/
|
|
23
271
|
rolling_quantile(quantile: number, windowSize: number): this;
|
|
272
|
+
/**
|
|
273
|
+
* Window: Computes rolling window rank.
|
|
274
|
+
* @param windowSize Size of rolling window.
|
|
275
|
+
* @returns ColumnExpression
|
|
276
|
+
* @example
|
|
277
|
+
* >>> const df = $df.data({ val: [10, 20, 15] })
|
|
278
|
+
* >>> df.with_columns($df.col("val").rolling_rank(2).alias("r_rank"))
|
|
279
|
+
* shape: (3, 2)
|
|
280
|
+
* ┌─────┬────────┐
|
|
281
|
+
* │ val │ r_rank │
|
|
282
|
+
* ├─────┼────────┤
|
|
283
|
+
* │ 10 │ 1 │
|
|
284
|
+
* │ 20 │ 2 │
|
|
285
|
+
* │ 15 │ 1 │
|
|
286
|
+
* └─────┴────────┘
|
|
287
|
+
*/
|
|
24
288
|
rolling_rank(windowSize: number): this;
|
|
289
|
+
/**
|
|
290
|
+
* Window: Computes rolling window standard deviation.
|
|
291
|
+
* @param windowSize Size of rolling window.
|
|
292
|
+
* @returns ColumnExpression
|
|
293
|
+
* @example
|
|
294
|
+
* >>> const df = $df.data({ val: [10, 20, 30] })
|
|
295
|
+
* >>> df.with_columns($df.col("val").rolling_std(2).alias("r_std"))
|
|
296
|
+
* shape: (3, 2)
|
|
297
|
+
* ┌─────┬────────┐
|
|
298
|
+
* │ val │ r_std │
|
|
299
|
+
* ├─────┼────────┤
|
|
300
|
+
* │ 10 │ 0 │
|
|
301
|
+
* │ 20 │ 7.071 │
|
|
302
|
+
* │ 30 │ 7.071 │
|
|
303
|
+
* └─────┴────────┘
|
|
304
|
+
*/
|
|
25
305
|
rolling_std(windowSize: number): this;
|
|
306
|
+
/**
|
|
307
|
+
* Window: Computes rolling window sum.
|
|
308
|
+
* @param windowSize Size of rolling window.
|
|
309
|
+
* @returns ColumnExpression
|
|
310
|
+
* @example
|
|
311
|
+
* >>> const df = $df.data({ val: [10, 20, 30] })
|
|
312
|
+
* >>> df.with_columns($df.col("val").rolling_sum(2).alias("r_sum"))
|
|
313
|
+
* shape: (3, 2)
|
|
314
|
+
* ┌─────┬───────┐
|
|
315
|
+
* │ val │ r_sum │
|
|
316
|
+
* ├─────┼───────┤
|
|
317
|
+
* │ 10 │ 10 │
|
|
318
|
+
* │ 20 │ 30 │
|
|
319
|
+
* │ 30 │ 50 │
|
|
320
|
+
* └─────┴───────┘
|
|
321
|
+
*/
|
|
26
322
|
rolling_sum(windowSize: number): this;
|
|
323
|
+
/**
|
|
324
|
+
* Window: Computes 1-indexed row number count within group partitions.
|
|
325
|
+
* @returns ColumnExpression
|
|
326
|
+
* @example
|
|
327
|
+
* >>> const df = $df.data({ cat: ["A", "A", "B"] })
|
|
328
|
+
* >>> df.with_columns($df.col("cat").row_number().over("cat").alias("rn"))
|
|
329
|
+
* shape: (3, 2)
|
|
330
|
+
* ┌─────┬────┐
|
|
331
|
+
* │ cat │ rn │
|
|
332
|
+
* ├─────┼────┤
|
|
333
|
+
* │ A │ 1 │
|
|
334
|
+
* │ A │ 2 │
|
|
335
|
+
* │ B │ 1 │
|
|
336
|
+
* └─────┴────┘
|
|
337
|
+
*/
|
|
27
338
|
row_number(): this;
|
|
28
339
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** @typefile */
|
|
1
2
|
import type { IExpr } from "../types";
|
|
2
3
|
export type ExprConstructor = new (...args: any[]) => IExpr;
|
|
3
4
|
export interface RandomOptions {
|
|
@@ -5,3 +6,4 @@ export interface RandomOptions {
|
|
|
5
6
|
max?: number;
|
|
6
7
|
integer?: boolean;
|
|
7
8
|
}
|
|
9
|
+
export type NumericArg = number | IExpr | null;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const NEWLINE = "\n";
|
|
2
|
+
export declare const CARRIAGE_RETURN = "\r";
|
|
3
|
+
export declare const UTF8_BOM = "\uFEFF";
|
|
4
|
+
export declare const MS_PER_SECOND = 1000;
|
|
5
|
+
export declare const MS_PER_MINUTE = 60000;
|
|
6
|
+
export declare const MS_PER_HOUR = 3600000;
|
|
7
|
+
export declare const MS_PER_DAY = 86400000;
|
|
8
|
+
export declare const US_PER_MS = 1000;
|
|
9
|
+
export declare const NS_PER_MS = 1000000;
|
|
10
|
+
export declare const US_PER_MS_BI = 1000n;
|
|
11
|
+
export declare const NS_PER_MS_BI = 1000000n;
|