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.
Files changed (159) hide show
  1. package/README.md +125 -9
  2. package/dist/api.d.ts +3 -2
  3. package/dist/assets/index-DBhGK6Tp.css +1 -0
  4. package/dist/assets/index-DEJEV_tU.js +195 -0
  5. package/dist/columnExpressions/ColumnExpr.d.ts +14 -7
  6. package/dist/columnExpressions/ExprBase.d.ts +26 -12
  7. package/dist/columnExpressions/constants.d.ts +1 -0
  8. package/dist/columnExpressions/functions/all.d.ts +23 -0
  9. package/dist/columnExpressions/functions/coalesce.d.ts +31 -2
  10. package/dist/columnExpressions/functions/element.d.ts +26 -1
  11. package/dist/columnExpressions/functions/exclude.d.ts +24 -0
  12. package/dist/columnExpressions/functions/implode.d.ts +28 -0
  13. package/dist/columnExpressions/functions/lit.d.ts +27 -0
  14. package/dist/columnExpressions/functions/seq_range.d.ts +36 -0
  15. package/dist/columnExpressions/functions/struct.d.ts +31 -0
  16. package/dist/columnExpressions/functions/when.d.ts +38 -8
  17. package/dist/columnExpressions/index.d.ts +2 -1
  18. package/dist/columnExpressions/mixins/AggregationExpr.d.ts +336 -2
  19. package/dist/columnExpressions/mixins/ArithmeticExpr.d.ts +620 -10
  20. package/dist/columnExpressions/mixins/ArrayExpr.d.ts +567 -0
  21. package/dist/columnExpressions/mixins/ComparisonExpr.d.ts +353 -0
  22. package/dist/columnExpressions/mixins/LogicalExpr.d.ts +82 -0
  23. package/dist/columnExpressions/mixins/ManipulationExpr.d.ts +40 -0
  24. package/dist/columnExpressions/mixins/StringExpr.d.ts +658 -5
  25. package/dist/columnExpressions/mixins/StructExpr.d.ts +70 -0
  26. package/dist/columnExpressions/mixins/TemporalExpr.d.ts +530 -4
  27. package/dist/columnExpressions/mixins/WindowExpr.d.ts +313 -2
  28. package/dist/columnExpressions/types.d.ts +2 -0
  29. package/dist/constants.d.ts +11 -0
  30. package/dist/dataframe/dataframe.d.ts +933 -3
  31. package/dist/dataframe/grouped/grouped.d.ts +41 -6
  32. package/dist/dataframe/types.d.ts +1 -0
  33. package/dist/dataframe/utils.d.ts +1 -0
  34. package/dist/datatypes/index.d.ts +3 -2
  35. package/dist/datatypes/types.d.ts +52 -7
  36. package/dist/exceptions/index.d.ts +23 -0
  37. package/dist/functions/concat.d.ts +50 -0
  38. package/dist/functions/read_csv.d.ts +9 -0
  39. package/dist/functions/read_json.d.ts +7 -2
  40. package/dist/index.html +17 -0
  41. package/dist/index.js +6 -6
  42. package/dist/index.mjs +6 -0
  43. package/dist/types.d.ts +51 -16
  44. package/dist/utils/{list.d.ts → array.d.ts} +68 -15
  45. package/dist/utils/binary.d.ts +3 -0
  46. package/dist/utils/csv.d.ts +1 -0
  47. package/dist/utils/date.d.ts +23 -54
  48. package/dist/utils/index.d.ts +3 -2
  49. package/dist/utils/json.d.ts +1 -0
  50. package/dist/utils/number.d.ts +15 -29
  51. package/dist/utils/object.d.ts +27 -0
  52. package/dist/utils/string.d.ts +15 -5
  53. package/package.json +18 -4
  54. package/dist/api.js +0 -26
  55. package/dist/bundle.min.js +0 -1
  56. package/dist/columnExpressions/ColumnExpr.js +0 -219
  57. package/dist/columnExpressions/ExprBase.js +0 -92
  58. package/dist/columnExpressions/constants.js +0 -7
  59. package/dist/columnExpressions/functions/all.js +0 -11
  60. package/dist/columnExpressions/functions/coalesce.js +0 -44
  61. package/dist/columnExpressions/functions/element.js +0 -11
  62. package/dist/columnExpressions/functions/exclude.js +0 -13
  63. package/dist/columnExpressions/functions/implode.js +0 -7
  64. package/dist/columnExpressions/functions/lit.js +0 -17
  65. package/dist/columnExpressions/functions/repeat.d.ts +0 -47
  66. package/dist/columnExpressions/functions/repeat.js +0 -131
  67. package/dist/columnExpressions/functions/seq_range.js +0 -91
  68. package/dist/columnExpressions/functions/when.js +0 -85
  69. package/dist/columnExpressions/index.js +0 -38
  70. package/dist/columnExpressions/mixins/AggregationExpr.js +0 -76
  71. package/dist/columnExpressions/mixins/ArithmeticExpr.js +0 -131
  72. package/dist/columnExpressions/mixins/BooleanExpr.d.ts +0 -40
  73. package/dist/columnExpressions/mixins/BooleanExpr.js +0 -67
  74. package/dist/columnExpressions/mixins/ComparisonExpr.js +0 -250
  75. package/dist/columnExpressions/mixins/ListExpr.d.ts +0 -39
  76. package/dist/columnExpressions/mixins/ListExpr.js +0 -224
  77. package/dist/columnExpressions/mixins/LogicalExpr.js +0 -53
  78. package/dist/columnExpressions/mixins/ManipulationExpr.js +0 -71
  79. package/dist/columnExpressions/mixins/NumericExpr.d.ts +0 -92
  80. package/dist/columnExpressions/mixins/NumericExpr.js +0 -259
  81. package/dist/columnExpressions/mixins/StringExpr.js +0 -237
  82. package/dist/columnExpressions/mixins/StructExpr.js +0 -139
  83. package/dist/columnExpressions/mixins/TemporalExpr.js +0 -126
  84. package/dist/columnExpressions/mixins/WindowExpr.js +0 -151
  85. package/dist/columnExpressions/types.js +0 -2
  86. package/dist/columnExpressions/utils.js +0 -45
  87. package/dist/dataframe/constants.js +0 -7
  88. package/dist/dataframe/dataframe.js +0 -990
  89. package/dist/dataframe/grouped/grouped.js +0 -114
  90. package/dist/dataframe/index.js +0 -20
  91. package/dist/dataframe/types.js +0 -2
  92. package/dist/dataframe/utils.js +0 -307
  93. package/dist/datatypes/DataType.js +0 -76
  94. package/dist/datatypes/index.js +0 -46
  95. package/dist/datatypes/types/Binary.d.ts +0 -9
  96. package/dist/datatypes/types/Binary.js +0 -18
  97. package/dist/datatypes/types/Boolean.d.ts +0 -9
  98. package/dist/datatypes/types/Boolean.js +0 -19
  99. package/dist/datatypes/types/Date.d.ts +0 -8
  100. package/dist/datatypes/types/Date.js +0 -21
  101. package/dist/datatypes/types/Datetime.d.ts +0 -8
  102. package/dist/datatypes/types/Datetime.js +0 -17
  103. package/dist/datatypes/types/Decimal.d.ts +0 -10
  104. package/dist/datatypes/types/Decimal.js +0 -28
  105. package/dist/datatypes/types/Duration.d.ts +0 -8
  106. package/dist/datatypes/types/Duration.js +0 -17
  107. package/dist/datatypes/types/Float32.d.ts +0 -8
  108. package/dist/datatypes/types/Float32.js +0 -17
  109. package/dist/datatypes/types/Float64.d.ts +0 -8
  110. package/dist/datatypes/types/Float64.js +0 -17
  111. package/dist/datatypes/types/Int16.d.ts +0 -8
  112. package/dist/datatypes/types/Int16.js +0 -17
  113. package/dist/datatypes/types/Int32.d.ts +0 -8
  114. package/dist/datatypes/types/Int32.js +0 -17
  115. package/dist/datatypes/types/Int64.d.ts +0 -8
  116. package/dist/datatypes/types/Int64.js +0 -17
  117. package/dist/datatypes/types/Int8.d.ts +0 -8
  118. package/dist/datatypes/types/Int8.js +0 -17
  119. package/dist/datatypes/types/List.d.ts +0 -10
  120. package/dist/datatypes/types/List.js +0 -31
  121. package/dist/datatypes/types/Null.d.ts +0 -9
  122. package/dist/datatypes/types/Null.js +0 -17
  123. package/dist/datatypes/types/Object.d.ts +0 -9
  124. package/dist/datatypes/types/Object.js +0 -17
  125. package/dist/datatypes/types/Struct.d.ts +0 -14
  126. package/dist/datatypes/types/Struct.js +0 -39
  127. package/dist/datatypes/types/Time.d.ts +0 -8
  128. package/dist/datatypes/types/Time.js +0 -29
  129. package/dist/datatypes/types/UInt16.d.ts +0 -8
  130. package/dist/datatypes/types/UInt16.js +0 -17
  131. package/dist/datatypes/types/UInt32.d.ts +0 -8
  132. package/dist/datatypes/types/UInt32.js +0 -17
  133. package/dist/datatypes/types/UInt64.d.ts +0 -8
  134. package/dist/datatypes/types/UInt64.js +0 -17
  135. package/dist/datatypes/types/UInt8.d.ts +0 -8
  136. package/dist/datatypes/types/UInt8.js +0 -17
  137. package/dist/datatypes/types/Utf8.d.ts +0 -10
  138. package/dist/datatypes/types/Utf8.js +0 -20
  139. package/dist/datatypes/types.js +0 -290
  140. package/dist/exceptions/index.js +0 -46
  141. package/dist/exceptions/utils.js +0 -28
  142. package/dist/functions/concat.js +0 -260
  143. package/dist/functions/index.js +0 -9
  144. package/dist/functions/read_csv.js +0 -53
  145. package/dist/functions/read_json.js +0 -21
  146. package/dist/functions/transpose.d.ts +0 -7
  147. package/dist/functions/transpose.js +0 -84
  148. package/dist/types.js +0 -2
  149. package/dist/utils/boolean.d.ts +0 -1
  150. package/dist/utils/boolean.js +0 -18
  151. package/dist/utils/csv.js +0 -313
  152. package/dist/utils/date.js +0 -348
  153. package/dist/utils/guards.d.ts +0 -12
  154. package/dist/utils/guards.js +0 -112
  155. package/dist/utils/index.js +0 -23
  156. package/dist/utils/json.js +0 -217
  157. package/dist/utils/list.js +0 -361
  158. package/dist/utils/number.js +0 -401
  159. package/dist/utils/string.js +0 -209
@@ -1,31 +1,384 @@
1
1
  import { ExprBase } from "../ExprBase";
2
+ /**
3
+ * @namespace $df.col
4
+ * @category ColumnExpression
5
+ * @syntax $df.col(<column_name>).{symbol}(...)
6
+ */
2
7
  export declare class ComparisonExpr extends ExprBase {
8
+ /**
9
+ * Checks if values fall inside lower and upper boundaries (inclusive).
10
+ * @param lower The lower boundary value or expression.
11
+ * @param upper The upper boundary value or expression.
12
+ * @param closed Control boundary inclusivity: "both", "left", "right", or "none" (default: "both").
13
+ * @returns ColumnExpression
14
+ * @example
15
+ * >>> df.with_columns($df.col("a").between(1, 2).alias("in_range"))
16
+ * shape: (3, 3)
17
+ * ┌───┬───┬──────────┐
18
+ * │ a │ b │ in_range │
19
+ * ├───┼───┼──────────┤
20
+ * │ 1 │ x │ true │
21
+ * │ 2 │ y │ true │
22
+ * │ 3 │ z │ false │
23
+ * └───┴───┴──────────┘
24
+ */
3
25
  between(lower: any, upper: any, closed?: "both" | "left" | "right" | "none"): this;
26
+ /**
27
+ * Boolean comparison: Returns true if column values match the specified value exactly.
28
+ * @param val The value or column expression to compare against.
29
+ * @returns ColumnExpression
30
+ * @example
31
+ * >>> const df = $df.data({
32
+ * ... a: [1, 2, 3]
33
+ * ... })
34
+ * shape: (3, 1)
35
+ * ┌───┐
36
+ * │ a │
37
+ * ├───┤
38
+ * │ 1 │
39
+ * │ 2 │
40
+ * │ 3 │
41
+ * └───┘
42
+ *
43
+ * >>> df.with_columns($df.col("a").eq(2).alias("is_two"))
44
+ * shape: (3, 2)
45
+ * ┌───┬────────┐
46
+ * │ a │ is_two │
47
+ * ├───┼────────┤
48
+ * │ 1 │ false │
49
+ * │ 2 │ true │
50
+ * │ 3 │ false │
51
+ * └───┴────────┘
52
+ */
4
53
  eq(val: any): this;
54
+ /**
55
+ * Equivalence check that treats null values as equal to each other.
56
+ * @param val The value or column expression to compare against.
57
+ * @returns ColumnExpression
58
+ * @example
59
+ * >>> const df = $df.data({ a: [1, null, 3] })
60
+ * >>> df.with_columns($df.col("a").eq_missing(null).alias("is_missing"))
61
+ * shape: (3, 2)
62
+ * ┌──────┬────────────┐
63
+ * │ a │ is_missing │
64
+ * ├──────┼────────────┤
65
+ * │ 1 │ false │
66
+ * │ null │ true │
67
+ * │ 3 │ false │
68
+ * └──────┴────────────┘
69
+ */
5
70
  eq_missing(val: any): this;
71
+ /**
72
+ * Boolean comparison: Returns true if greater than or equal to argument.
73
+ * @param val The value or column expression to compare against.
74
+ * @returns ColumnExpression
75
+ * @example
76
+ * >>> const df = $df.data({ price: [90, 100, 110] })
77
+ * >>> df.with_columns($df.col("price").ge(100).alias("ge_100"))
78
+ * shape: (3, 2)
79
+ * ┌───────┬────────┐
80
+ * │ price │ ge_100 │
81
+ * ├───────┼────────┤
82
+ * │ 90 │ false │
83
+ * │ 100 │ true │
84
+ * │ 110 │ true │
85
+ * └───────┴────────┘
86
+ */
6
87
  ge(val: any): this;
88
+ /**
89
+ * Boolean comparison: Returns true if column value is greater than argument.
90
+ * @param val The value or column expression to compare against.
91
+ * @returns ColumnExpression
92
+ * @example
93
+ * >>> const df = $df.data({ price: [90, 100, 110] })
94
+ * >>> df.with_columns($df.col("price").gt(100).alias("gt_100"))
95
+ * shape: (3, 2)
96
+ * ┌───────┬────────┐
97
+ * │ price │ gt_100 │
98
+ * ├───────┼────────┤
99
+ * │ 90 │ false │
100
+ * │ 100 │ false │
101
+ * │ 110 │ true │
102
+ * └───────┴────────┘
103
+ */
7
104
  gt(val: any): this;
105
+ /**
106
+ * Aggregation: Checks if any value in the group is null.
107
+ * @returns ColumnExpression
108
+ * @example
109
+ * >>> const df = $df.data({ group: ["A", "A"], val: [10, null] })
110
+ * >>> df.group_by("group").agg($df.col("val").has_nulls().alias("has_nulls"))
111
+ * shape: (1, 2)
112
+ * ┌───────┬───────────┐
113
+ * │ group │ has_nulls │
114
+ * ├───────┼───────────┤
115
+ * │ "A" │ true │
116
+ * └───────┴───────────┘
117
+ */
8
118
  has_nulls(): any;
119
+ /**
120
+ * Determines if floating-point values are approximately equal within tolerances.
121
+ * @param other The value or expression to compare against.
122
+ * @param options Tolerance values absolute (abs_tol) and relative (rel_tol), and NaN options.
123
+ * @returns ColumnExpression
124
+ * @example
125
+ * >>> const df = $df.data({ a: [1.000000001, 2.0] })
126
+ * >>> df.with_columns($df.col("a").is_close(1.0).alias("close"))
127
+ * shape: (2, 2)
128
+ * ┌─────────────┬───────┐
129
+ * │ a │ close │
130
+ * ├─────────────┼───────┤
131
+ * │ 1.000000001 │ true │
132
+ * │ 2.0 │ false │
133
+ * └─────────────┴───────┘
134
+ */
9
135
  is_close(other: any, { abs_tol, rel_tol, nans_equal }?: {
10
136
  abs_tol?: number;
11
137
  rel_tol?: number;
12
138
  nans_equal?: boolean;
13
139
  }): this;
140
+ /**
141
+ * Checks if values occur more than once in the column.
142
+ * @returns ColumnExpression
143
+ * @example
144
+ * >>> const df = $df.data({ a: [1, 2, 2] })
145
+ * >>> df.with_columns($df.col("a").is_duplicated().alias("dup"))
146
+ * shape: (3, 2)
147
+ * ┌───┬───────┐
148
+ * │ a │ dup │
149
+ * ├───┼───────┤
150
+ * │ 1 │ false │
151
+ * │ 2 │ true │
152
+ * │ 2 │ true │
153
+ * └───┴───────┘
154
+ */
14
155
  is_duplicated(): this;
156
+ /**
157
+ * Checks if strings or nested arrays have length 0.
158
+ * @param options Config options including whether to ignore nulls inside arrays.
159
+ * @returns ColumnExpression
160
+ * @example
161
+ * >>> const df = $df.data({ a: ["", "hello", []] })
162
+ * >>> df.with_columns($df.col("a").is_empty().alias("empty"))
163
+ * shape: (3, 2)
164
+ * ┌─────────┬───────┐
165
+ * │ a │ empty │
166
+ * ├─────────┼───────┤
167
+ * │ "" │ true │
168
+ * │ "hello" │ false │
169
+ * │ [] │ true │
170
+ * └─────────┴───────┘
171
+ */
15
172
  is_empty({ ignoreNulls }?: {
16
173
  ignoreNulls?: boolean;
17
174
  }): this;
175
+ /**
176
+ * Checks if values are finite numbers (not NaN or Infinity).
177
+ * @returns ColumnExpression
178
+ * @example
179
+ * >>> const df = $df.data({ a: [1.5, Infinity, NaN] })
180
+ * >>> df.with_columns($df.col("a").is_finite().alias("finite"))
181
+ * shape: (3, 2)
182
+ * ┌──────────┬────────┐
183
+ * │ a │ finite │
184
+ * ├──────────┼────────┤
185
+ * │ 1.5 │ true │
186
+ * │ Infinity │ false │
187
+ * │ NaN │ false │
188
+ * └──────────┴────────┘
189
+ */
18
190
  is_finite(): this;
191
+ /**
192
+ * Checks if column values are members of a specified array or list.
193
+ * @param values An array of candidate values or a single value to match against.
194
+ * @returns ColumnExpression
195
+ * @example
196
+ * >>> const df = $df.data({ category: ["toys", "books", "food"] })
197
+ * >>> df.with_columns($df.col("category").is_in(["toys", "books"]).alias("in_list"))
198
+ * shape: (3, 2)
199
+ * ┌──────────┬─────────┐
200
+ * │ category │ in_list │
201
+ * ├──────────┼─────────┤
202
+ * │ "toys" │ true │
203
+ * │ "books" │ true │
204
+ * │ "food" │ false │
205
+ * └──────────┴─────────┘
206
+ */
19
207
  is_in(values: any[] | any): this;
208
+ /**
209
+ * Checks if values are positive or negative Infinity.
210
+ * @returns ColumnExpression
211
+ * @example
212
+ * >>> const df = $df.data({ a: [1.5, Infinity, -Infinity] })
213
+ * >>> df.with_columns($df.col("a").is_infinite().alias("inf"))
214
+ * shape: (3, 2)
215
+ * ┌───────────┬───────┐
216
+ * │ a │ inf │
217
+ * ├───────────┼───────┤
218
+ * │ 1.5 │ false │
219
+ * │ Infinity │ true │
220
+ * │ -Infinity │ true │
221
+ * └───────────┴───────┘
222
+ */
20
223
  is_infinite(): this;
224
+ /**
225
+ * Checks if values are NaN.
226
+ * @returns ColumnExpression
227
+ * @example
228
+ * >>> const df = $df.data({ a: [1.5, NaN] })
229
+ * >>> df.with_columns($df.col("a").is_nan().alias("nan"))
230
+ * shape: (2, 2)
231
+ * ┌─────┬───────┐
232
+ * │ a │ nan │
233
+ * ├─────┼───────┤
234
+ * │ 1.5 │ false │
235
+ * │ NaN │ true │
236
+ * └─────┴───────┘
237
+ */
21
238
  is_nan(): this;
239
+ /**
240
+ * Checks if values are not NaN.
241
+ * @returns ColumnExpression
242
+ * @example
243
+ * >>> const df = $df.data({ a: [1.5, NaN] })
244
+ * >>> df.with_columns($df.col("a").is_not_nan().alias("not_nan"))
245
+ * shape: (2, 2)
246
+ * ┌─────┬─────────┐
247
+ * │ a │ not_nan │
248
+ * ├─────┼─────────┤
249
+ * │ 1.5 │ true │
250
+ * │ NaN │ false │
251
+ * └─────┴─────────┘
252
+ */
22
253
  is_not_nan(): this;
254
+ /**
255
+ * Checks if column values are non-null and valid (not null, undefined, or missing).
256
+ * @returns ColumnExpression
257
+ * @example
258
+ * >>> const df = $df.data({ email: ["alice@example.com", null] })
259
+ * >>> df.with_columns($df.col("email").is_not_null().alias("valid"))
260
+ * shape: (2, 2)
261
+ * ┌───────────────────┬───────┐
262
+ * │ email │ valid │
263
+ * ├───────────────────┼───────┤
264
+ * │ alice@example.com │ true │
265
+ * │ null │ false │
266
+ * └───────────────────┴───────┘
267
+ */
23
268
  is_not_null(): this;
269
+ /**
270
+ * Checks if column values are null, undefined, or missing.
271
+ * @returns ColumnExpression
272
+ * @example
273
+ * >>> const df = $df.data({ email: ["alice@example.com", null] })
274
+ * >>> df.with_columns($df.col("email").is_null().alias("missing"))
275
+ * shape: (2, 2)
276
+ * ┌───────────────────┬─────────┐
277
+ * │ email │ missing │
278
+ * ├───────────────────┼─────────┤
279
+ * │ alice@example.com │ false │
280
+ * │ null │ true │
281
+ * └───────────────────┴─────────┘
282
+ */
24
283
  is_null(): this;
284
+ /**
285
+ * Checks if values occur exactly once in the column.
286
+ * @returns ColumnExpression
287
+ * @example
288
+ * >>> const df = $df.data({ a: [1, 2, 2] })
289
+ * >>> df.with_columns($df.col("a").is_unique().alias("uniq"))
290
+ * shape: (3, 2)
291
+ * ┌───┬───────┐
292
+ * │ a │ uniq │
293
+ * ├───┼───────┤
294
+ * │ 1 │ true │
295
+ * │ 2 │ false │
296
+ * │ 2 │ false │
297
+ * └───┴───────┘
298
+ */
25
299
  is_unique(): this;
300
+ /**
301
+ * Boolean comparison: Returns true if less than or equal to argument.
302
+ * @param val The value or column expression to compare against.
303
+ * @returns ColumnExpression
304
+ * @example
305
+ * >>> const df = $df.data({ price: [40, 50, 60] })
306
+ * >>> df.with_columns($df.col("price").le(50).alias("le_50"))
307
+ * shape: (3, 2)
308
+ * ┌───────┬───────┐
309
+ * │ price │ le_50 │
310
+ * ├───────┼───────┤
311
+ * │ 40 │ true │
312
+ * │ 50 │ true │
313
+ * │ 60 │ false │
314
+ * └───────┴───────┘
315
+ */
26
316
  le(val: any): this;
317
+ /**
318
+ * Boolean comparison: Returns true if less than argument.
319
+ * @param val The value or column expression to compare against.
320
+ * @returns ColumnExpression
321
+ * @example
322
+ * >>> const df = $df.data({ price: [40, 50, 60] })
323
+ * >>> df.with_columns($df.col("price").lt(50).alias("lt_50"))
324
+ * shape: (3, 2)
325
+ * ┌───────┬───────┐
326
+ * │ price │ lt_50 │
327
+ * ├───────┼───────┤
328
+ * │ 40 │ true │
329
+ * │ 50 │ false │
330
+ * │ 60 │ false │
331
+ * └───────┴───────┘
332
+ */
27
333
  lt(val: any): this;
334
+ /**
335
+ * Boolean comparison: Returns true if values do not match.
336
+ * @param val The value or column expression to compare against.
337
+ * @returns ColumnExpression
338
+ * @example
339
+ * >>> const df = $df.data({ category: ["electronics", "toys"] })
340
+ * >>> df.with_columns($df.col("category").ne("electronics").alias("not_elec"))
341
+ * shape: (2, 2)
342
+ * ┌─────────────┬──────────┐
343
+ * │ category │ not_elec │
344
+ * ├─────────────┼──────────┤
345
+ * │ electronics │ false │
346
+ * │ toys │ true │
347
+ * └─────────────┴──────────┘
348
+ */
28
349
  ne(val: any): this;
350
+ /**
351
+ * Difference check that treats null values as equal to each other.
352
+ * @param val The value or column expression to compare against.
353
+ * @returns ColumnExpression
354
+ * @example
355
+ * >>> const df = $df.data({ a: [1, null, 3] })
356
+ * >>> df.with_columns($df.col("a").ne_missing(null).alias("not_missing"))
357
+ * shape: (3, 2)
358
+ * ┌──────┬─────────────┐
359
+ * │ a │ not_missing │
360
+ * ├──────┼─────────────┤
361
+ * │ 1 │ true │
362
+ * │ null │ false │
363
+ * │ 3 │ true │
364
+ * └──────┴─────────────┘
365
+ */
29
366
  ne_missing(val: any): this;
367
+ /**
368
+ * Checks if values are not elements of a specific array or set list.
369
+ * @param values An array of candidate values or a single value to match against.
370
+ * @returns ColumnExpression
371
+ * @example
372
+ * >>> const df = $df.data({ category: ["toys", "books", "food"] })
373
+ * >>> df.with_columns($df.col("category").not_in(["toys", "books"]).alias("not_in"))
374
+ * shape: (3, 2)
375
+ * ┌──────────┬────────┐
376
+ * │ category │ not_in │
377
+ * ├──────────┼────────┤
378
+ * │ toys │ false │
379
+ * │ books │ false │
380
+ * │ food │ true │
381
+ * └──────────┴────────┘
382
+ */
30
383
  not_in(values: any[] | any): this;
31
384
  }
@@ -1,7 +1,89 @@
1
1
  import { ExprBase } from "../ExprBase";
2
+ /**
3
+ * @namespace $df.col
4
+ * @category ColumnExpression
5
+ * @syntax $df.col(<column_name>).{symbol}(...)
6
+ */
2
7
  export declare class LogicalExpr extends ExprBase {
8
+ /**
9
+ * Logical AND check supporting Kleene logic.
10
+ * @param other The other boolean column expression or literal value to compare.
11
+ * @returns ColumnExpression
12
+ * @example
13
+ * >>> const df = $df.data({
14
+ * ... a: [true, true, false, null],
15
+ * ... b: [true, false, false, true]
16
+ * ... })
17
+ * >>> df.with_columns($df.col("a").and($df.col("b")).alias("and_res"))
18
+ * shape: (4, 3)
19
+ * ┌───────┬───────┬─────────┐
20
+ * │ a │ b │ and_res │
21
+ * ├───────┼───────┼─────────┤
22
+ * │ true │ true │ true │
23
+ * │ true │ false │ false │
24
+ * │ false │ false │ false │
25
+ * │ null │ true │ null │
26
+ * └───────┴───────┴─────────┘
27
+ */
3
28
  and(other: any): this;
29
+ /**
30
+ * Logical negation.
31
+ * @returns ColumnExpression
32
+ * @example
33
+ * >>> const df = $df.data({
34
+ * ... is_active: [true, false, null]
35
+ * ... })
36
+ * >>> df.with_columns($df.col("is_active").not().alias("is_inactive"))
37
+ * shape: (3, 2)
38
+ * ┌───────────┬─────────────┐
39
+ * │ is_active │ is_inactive │
40
+ * ├───────────┼─────────────┤
41
+ * │ true │ false │
42
+ * │ false │ true │
43
+ * │ null │ null │
44
+ * └───────────┴─────────────┘
45
+ */
4
46
  not(): this;
47
+ /**
48
+ * Logical OR check supporting Kleene logic.
49
+ * @param other The other boolean column expression or literal value to compare.
50
+ * @returns ColumnExpression
51
+ * @example
52
+ * >>> const df = $df.data({
53
+ * ... a: [true, false, false, null],
54
+ * ... b: [false, false, true, false]
55
+ * ... })
56
+ * >>> df.with_columns($df.col("a").or($df.col("b")).alias("or_res"))
57
+ * shape: (4, 3)
58
+ * ┌───────┬───────┬────────┐
59
+ * │ a │ b │ or_res │
60
+ * ├───────┼───────┼────────┤
61
+ * │ true │ false │ true │
62
+ * │ false │ false │ false │
63
+ * │ false │ true │ true │
64
+ * │ null │ false │ null │
65
+ * └───────┴───────┴────────┘
66
+ */
5
67
  or(other: any): this;
68
+ /**
69
+ * Logical XOR check.
70
+ * @param other The other boolean column expression or literal value to compare.
71
+ * @returns ColumnExpression
72
+ * @example
73
+ * >>> const df = $df.data({
74
+ * ... a: [true, true, false, false],
75
+ * ... b: [true, false, true, false]
76
+ * ... })
77
+ * >>> df.with_columns($df.col("a").xor($df.col("b")).alias("xor_res"))
78
+ * shape: (4, 3)
79
+ * ┌───────┬───────┬─────────┐
80
+ * │ a │ b │ xor_res │
81
+ * ├───────┼───────┼─────────┤
82
+ * │ true │ true │ false │
83
+ * │ true │ false │ true │
84
+ * │ false │ true │ true │
85
+ * │ false │ false │ false │
86
+ * └───────┴───────┴─────────┘
87
+ */
6
88
  xor(other: any): this;
7
89
  }
@@ -1,6 +1,46 @@
1
1
  import { ExprBase } from "../ExprBase";
2
2
  import type { FillNullOptions } from "../../types";
3
+ /**
4
+ * @namespace $df.col
5
+ * @category ColumnExpression
6
+ * @syntax $df.col(<column_name>).{symbol}(...)
7
+ */
3
8
  export declare class ManipulationExpr extends ExprBase {
9
+ /**
10
+ * Replaces null, undefined, or missing values with a specified value or strategy.
11
+ * @param options Configuration options including fill value, strategy ("forward", "backward", "zero", "one", "mean", "min", "max"), and optional limit.
12
+ * @returns ColumnExpression
13
+ * @example
14
+ * >>> const df = $df.data({
15
+ * ... a: [1, null, 3]
16
+ * ... })
17
+ * >>> df.with_columns($df.col("a").fill_null({ value: 0 }).alias("filled"))
18
+ * shape: (3, 2)
19
+ * ┌──────┬────────┐
20
+ * │ a │ filled │
21
+ * ├──────┼────────┤
22
+ * │ 1 │ 1 │
23
+ * │ null │ 0 │
24
+ * │ 3 │ 3 │
25
+ * └──────┴────────┘
26
+ */
4
27
  fill_null({ value, strategy, limit }?: FillNullOptions): this;
28
+ /**
29
+ * Reverses the order of values in the column.
30
+ * @returns ColumnExpression
31
+ * @example
32
+ * >>> const df = $df.data({
33
+ * ... a: [1, 2, 3]
34
+ * ... })
35
+ * >>> df.with_columns($df.col("a").reverse().alias("reversed"))
36
+ * shape: (3, 2)
37
+ * ┌───┬──────────┐
38
+ * │ a │ reversed │
39
+ * ├───┼──────────┤
40
+ * │ 1 │ 3 │
41
+ * │ 2 │ 2 │
42
+ * │ 3 │ 1 │
43
+ * └───┴──────────┘
44
+ */
5
45
  reverse(): this;
6
46
  }