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.
- package/README.md +148 -235
- package/dist/api.d.ts +41 -36
- package/dist/columnExpressions/ColumnExpr.d.ts +5 -8
- package/dist/columnExpressions/functions/all.d.ts +13 -13
- package/dist/columnExpressions/functions/coalesce.d.ts +2 -2
- package/dist/columnExpressions/functions/duration.d.ts +16 -21
- package/dist/columnExpressions/functions/element.d.ts +10 -10
- package/dist/columnExpressions/functions/exclude.d.ts +14 -14
- package/dist/columnExpressions/functions/implode.d.ts +7 -7
- package/dist/columnExpressions/functions/lit.d.ts +9 -9
- package/dist/columnExpressions/functions/seqRange.d.ts +69 -0
- package/dist/columnExpressions/functions/struct.d.ts +6 -6
- package/dist/columnExpressions/functions/when.d.ts +25 -28
- package/dist/columnExpressions/index.d.ts +3 -7
- package/dist/columnExpressions/mixins/AggregationExpr.d.ts +550 -221
- package/dist/columnExpressions/mixins/ArithmeticExpr.d.ts +701 -327
- package/dist/columnExpressions/mixins/ArrayExpr.d.ts +508 -212
- package/dist/columnExpressions/mixins/ComparisonExpr.d.ts +398 -201
- package/dist/columnExpressions/mixins/LogicalExpr.d.ts +59 -29
- package/dist/columnExpressions/mixins/ManipulationExpr.d.ts +23 -9
- package/dist/columnExpressions/mixins/StandardExpr.d.ts +3234 -0
- package/dist/columnExpressions/mixins/StringExpr.d.ts +1163 -524
- package/dist/columnExpressions/mixins/StructExpr.d.ts +67 -25
- package/dist/columnExpressions/mixins/TemporalExpr.d.ts +518 -212
- package/dist/columnExpressions/mixins/WindowExpr.d.ts +270 -102
- package/dist/columnExpressions/typeInference.d.ts +3 -3
- package/dist/columnExpressions/types.d.ts +5 -0
- package/dist/columnExpressions/utils.d.ts +7 -0
- package/dist/constants.d.ts +11 -2
- package/dist/dataframe/dataframe.d.ts +755 -592
- package/dist/dataframe/grouped/grouped.d.ts +24 -6
- package/dist/dataframe/grouped.d.ts +70 -0
- package/dist/dataframe/index.d.ts +1 -1
- package/dist/dataframe/lazy.d.ts +37 -0
- package/dist/dataframe/types.d.ts +46 -22
- package/dist/dataframe/utils.d.ts +10 -4
- package/dist/datatypes/index.d.ts +11 -4
- package/dist/expressions.js +1 -0
- package/dist/expressions.mjs +1 -0
- package/dist/functions/concat.d.ts +68 -16
- package/dist/functions/index.d.ts +2 -2
- package/dist/functions/readCsv.d.ts +35 -0
- package/dist/functions/readJson.d.ts +33 -0
- package/dist/index.js +5 -6
- package/dist/index.mjs +5 -6
- package/dist/types.d.ts +42 -9
- package/dist/utils/array.d.ts +17 -14
- package/dist/utils/csv.d.ts +4 -1
- package/dist/utils/date.d.ts +3 -19
- package/dist/utils/duration.d.ts +7 -5
- package/dist/utils/json.d.ts +5 -3
- package/dist/utils/object.d.ts +0 -18
- package/dist/utils/string.d.ts +5 -0
- package/dist/utils.js +4 -0
- package/dist/utils.mjs +4 -0
- package/package.json +29 -8
- package/dist/assets/index-DBhGK6Tp.css +0 -1
- package/dist/assets/index-DEJEV_tU.js +0 -195
- package/dist/index.html +0 -17
|
@@ -10,11 +10,18 @@ export declare class LogicalExpr extends ExprBase {
|
|
|
10
10
|
* @param other The other boolean column expression or literal value to compare.
|
|
11
11
|
* @returns ColumnExpression
|
|
12
12
|
* @example
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
* >>> const df = $df.data({ a: [true, true, false, false], b: [true, false, true, false] })
|
|
14
|
+
* >>> df
|
|
15
|
+
* shape: (4, 2)
|
|
16
|
+
* ┌───────┬───────┐
|
|
17
|
+
* │ a │ b │
|
|
18
|
+
* ├───────┼───────┤
|
|
19
|
+
* │ true │ true │
|
|
20
|
+
* │ true │ false │
|
|
21
|
+
* │ false │ true │
|
|
22
|
+
* │ false │ false │
|
|
23
|
+
* └───────┴───────┘
|
|
24
|
+
* >>> df.withColumns($df.col("a").and($df.col("b")).alias("and_res"))
|
|
18
25
|
* shape: (4, 3)
|
|
19
26
|
* ┌───────┬───────┬─────────┐
|
|
20
27
|
* │ a │ b │ and_res │
|
|
@@ -30,18 +37,27 @@ export declare class LogicalExpr extends ExprBase {
|
|
|
30
37
|
* Logical negation.
|
|
31
38
|
* @returns ColumnExpression
|
|
32
39
|
* @example
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
*
|
|
40
|
+
* >>> const df = $df.data({ a: [true, true, false, false], b: [true, false, true, false] })
|
|
41
|
+
* >>> df
|
|
42
|
+
* shape: (4, 2)
|
|
43
|
+
* ┌───────┬───────┐
|
|
44
|
+
* │ a │ b │
|
|
45
|
+
* ├───────┼───────┤
|
|
46
|
+
* │ true │ true │
|
|
47
|
+
* │ true │ false │
|
|
48
|
+
* │ false │ true │
|
|
49
|
+
* │ false │ false │
|
|
50
|
+
* └───────┴───────┘
|
|
51
|
+
* >>> df.withColumns($df.col("a").not().alias("not_a"))
|
|
52
|
+
* shape: (4, 3)
|
|
53
|
+
* ┌───────┬───────┬───────┐
|
|
54
|
+
* │ a │ b │ not_a │
|
|
55
|
+
* ├───────┼───────┼───────┤
|
|
56
|
+
* │ true │ true │ false │
|
|
57
|
+
* │ true │ false │ false │
|
|
58
|
+
* │ false │ false │ true │
|
|
59
|
+
* │ null │ true │ null │
|
|
60
|
+
* └───────┴───────┴───────┘
|
|
45
61
|
*/
|
|
46
62
|
not(): this;
|
|
47
63
|
/**
|
|
@@ -49,19 +65,26 @@ export declare class LogicalExpr extends ExprBase {
|
|
|
49
65
|
* @param other The other boolean column expression or literal value to compare.
|
|
50
66
|
* @returns ColumnExpression
|
|
51
67
|
* @example
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
68
|
+
* >>> const df = $df.data({ a: [true, true, false, false], b: [true, false, true, false] })
|
|
69
|
+
* >>> df
|
|
70
|
+
* shape: (4, 2)
|
|
71
|
+
* ┌───────┬───────┐
|
|
72
|
+
* │ a │ b │
|
|
73
|
+
* ├───────┼───────┤
|
|
74
|
+
* │ true │ true │
|
|
75
|
+
* │ true │ false │
|
|
76
|
+
* │ false │ true │
|
|
77
|
+
* │ false │ false │
|
|
78
|
+
* └───────┴───────┘
|
|
79
|
+
* >>> df.withColumns($df.col("a").or($df.col("b")).alias("or_res"))
|
|
57
80
|
* shape: (4, 3)
|
|
58
81
|
* ┌───────┬───────┬────────┐
|
|
59
82
|
* │ a │ b │ or_res │
|
|
60
83
|
* ├───────┼───────┼────────┤
|
|
84
|
+
* │ true │ true │ true │
|
|
61
85
|
* │ true │ false │ true │
|
|
62
86
|
* │ false │ false │ false │
|
|
63
|
-
* │
|
|
64
|
-
* │ null │ false │ null │
|
|
87
|
+
* │ null │ true │ true │
|
|
65
88
|
* └───────┴───────┴────────┘
|
|
66
89
|
*/
|
|
67
90
|
or(other: any): this;
|
|
@@ -70,11 +93,18 @@ export declare class LogicalExpr extends ExprBase {
|
|
|
70
93
|
* @param other The other boolean column expression or literal value to compare.
|
|
71
94
|
* @returns ColumnExpression
|
|
72
95
|
* @example
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
96
|
+
* >>> const df = $df.data({ a: [true, true, false, false], b: [true, false, true, false] })
|
|
97
|
+
* >>> df
|
|
98
|
+
* shape: (4, 2)
|
|
99
|
+
* ┌───────┬───────┐
|
|
100
|
+
* │ a │ b │
|
|
101
|
+
* ├───────┼───────┤
|
|
102
|
+
* │ true │ true │
|
|
103
|
+
* │ true │ false │
|
|
104
|
+
* │ false │ true │
|
|
105
|
+
* │ false │ false │
|
|
106
|
+
* └───────┴───────┘
|
|
107
|
+
* >>> df.withColumns($df.col("a").xor($df.col("b")).alias("xor_res"))
|
|
78
108
|
* shape: (4, 3)
|
|
79
109
|
* ┌───────┬───────┬─────────┐
|
|
80
110
|
* │ a │ b │ xor_res │
|
|
@@ -11,10 +11,17 @@ export declare class ManipulationExpr extends ExprBase {
|
|
|
11
11
|
* @param options Configuration options including fill value, strategy ("forward", "backward", "zero", "one", "mean", "min", "max"), and optional limit.
|
|
12
12
|
* @returns ColumnExpression
|
|
13
13
|
* @example
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
* >>> const df = $df.data({ a: [1, null, 3], b: [null, 2, null] })
|
|
15
|
+
* >>> df
|
|
16
|
+
* shape: (3, 2)
|
|
17
|
+
* ┌──────┬──────┐
|
|
18
|
+
* │ a │ b │
|
|
19
|
+
* ├──────┼──────┤
|
|
20
|
+
* │ 1 │ null │
|
|
21
|
+
* │ null │ 2 │
|
|
22
|
+
* │ 3 │ null │
|
|
23
|
+
* └──────┴──────┘
|
|
24
|
+
* >>> df.withColumns($df.col("a").fillNull({ value: 0 }).alias("filled"))
|
|
18
25
|
* shape: (3, 2)
|
|
19
26
|
* ┌──────┬────────┐
|
|
20
27
|
* │ a │ filled │
|
|
@@ -24,15 +31,22 @@ export declare class ManipulationExpr extends ExprBase {
|
|
|
24
31
|
* │ 3 │ 3 │
|
|
25
32
|
* └──────┴────────┘
|
|
26
33
|
*/
|
|
27
|
-
|
|
34
|
+
fillNull({ value, strategy, limit }?: FillNullOptions): this;
|
|
28
35
|
/**
|
|
29
36
|
* Reverses the order of values in the column.
|
|
30
37
|
* @returns ColumnExpression
|
|
31
38
|
* @example
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
39
|
+
* >>> const df = $df.data({ a: [1, 2, 3] })
|
|
40
|
+
* >>> df
|
|
41
|
+
* shape: (3, 1)
|
|
42
|
+
* ┌───┐
|
|
43
|
+
* │ a │
|
|
44
|
+
* ├───┤
|
|
45
|
+
* │ 1 │
|
|
46
|
+
* │ 2 │
|
|
47
|
+
* │ 3 │
|
|
48
|
+
* └───┘
|
|
49
|
+
* >>> df.withColumns($df.col("a").reverse().alias("reversed"))
|
|
36
50
|
* shape: (3, 2)
|
|
37
51
|
* ┌───┬──────────┐
|
|
38
52
|
* │ a │ reversed │
|