polars-df 0.2.5 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/Cargo.lock +290 -137
- data/Cargo.toml +1 -1
- data/README.md +40 -2
- data/ext/polars/Cargo.toml +5 -4
- data/ext/polars/src/apply/dataframe.rs +6 -6
- data/ext/polars/src/apply/series.rs +10 -10
- data/ext/polars/src/batched_csv.rs +6 -4
- data/ext/polars/src/conversion.rs +56 -17
- data/ext/polars/src/dataframe.rs +65 -43
- data/ext/polars/src/error.rs +16 -8
- data/ext/polars/src/file.rs +5 -4
- data/ext/polars/src/lazy/apply.rs +1 -1
- data/ext/polars/src/lazy/dataframe.rs +12 -6
- data/ext/polars/src/lazy/dsl.rs +99 -45
- data/ext/polars/src/lazy/meta.rs +10 -9
- data/ext/polars/src/lib.rs +33 -29
- data/ext/polars/src/numo.rs +57 -0
- data/ext/polars/src/object.rs +2 -1
- data/ext/polars/src/series.rs +67 -53
- data/lib/polars/cat_expr.rb +0 -4
- data/lib/polars/cat_name_space.rb +0 -4
- data/lib/polars/convert.rb +0 -7
- data/lib/polars/data_frame.rb +165 -209
- data/lib/polars/data_types.rb +4 -0
- data/lib/polars/date_time_expr.rb +19 -151
- data/lib/polars/date_time_name_space.rb +17 -17
- data/lib/polars/expr.rb +68 -315
- data/lib/polars/group_by.rb +79 -51
- data/lib/polars/io.rb +1 -1
- data/lib/polars/lazy_frame.rb +1 -103
- data/lib/polars/lazy_functions.rb +0 -26
- data/lib/polars/lazy_group_by.rb +0 -8
- data/lib/polars/list_expr.rb +5 -27
- data/lib/polars/list_name_space.rb +5 -8
- data/lib/polars/plot.rb +109 -0
- data/lib/polars/series.rb +61 -19
- data/lib/polars/string_expr.rb +20 -76
- data/lib/polars/string_name_space.rb +5 -15
- data/lib/polars/struct_expr.rb +0 -2
- data/lib/polars/version.rb +1 -1
- data/lib/polars.rb +1 -0
- metadata +5 -3
data/lib/polars/data_types.rb
CHANGED
@@ -84,6 +84,8 @@ module Polars
|
|
84
84
|
|
85
85
|
# Calendar date and time type.
|
86
86
|
class Datetime < TemporalType
|
87
|
+
attr_reader :tu
|
88
|
+
|
87
89
|
def initialize(time_unit = "us", time_zone = nil)
|
88
90
|
@tu = time_unit || "us"
|
89
91
|
@time_zone = time_zone
|
@@ -92,6 +94,8 @@ module Polars
|
|
92
94
|
|
93
95
|
# Time duration/delta type.
|
94
96
|
class Duration < TemporalType
|
97
|
+
attr_reader :tu
|
98
|
+
|
95
99
|
def initialize(time_unit = "us")
|
96
100
|
@tu = time_unit
|
97
101
|
end
|
@@ -51,17 +51,11 @@ module Polars
|
|
51
51
|
# # │ datetime[μs] │
|
52
52
|
# # ╞═════════════════════╡
|
53
53
|
# # │ 2001-01-01 00:00:00 │
|
54
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
55
54
|
# # │ 2001-01-01 03:45:00 │
|
56
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
57
55
|
# # │ 2001-01-01 07:30:00 │
|
58
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
59
56
|
# # │ 2001-01-01 11:15:00 │
|
60
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
61
57
|
# # │ 2001-01-01 15:00:00 │
|
62
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
63
58
|
# # │ 2001-01-01 18:45:00 │
|
64
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
65
59
|
# # │ 2001-01-01 22:30:00 │
|
66
60
|
# # └─────────────────────┘
|
67
61
|
#
|
@@ -75,17 +69,11 @@ module Polars
|
|
75
69
|
# # │ datetime[μs] │
|
76
70
|
# # ╞═════════════════════╡
|
77
71
|
# # │ 2001-01-01 00:00:00 │
|
78
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
79
72
|
# # │ 2001-01-01 03:00:00 │
|
80
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
81
73
|
# # │ 2001-01-01 07:00:00 │
|
82
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
83
74
|
# # │ 2001-01-01 11:00:00 │
|
84
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
85
75
|
# # │ 2001-01-01 15:00:00 │
|
86
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
87
76
|
# # │ 2001-01-01 18:00:00 │
|
88
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
89
77
|
# # │ 2001-01-01 22:00:00 │
|
90
78
|
# # └─────────────────────┘
|
91
79
|
#
|
@@ -102,17 +90,11 @@ module Polars
|
|
102
90
|
# # │ datetime[μs] ┆ datetime[μs] │
|
103
91
|
# # ╞═════════════════════╪═════════════════════╡
|
104
92
|
# # │ 2001-01-01 00:00:00 ┆ 2001-01-01 00:00:00 │
|
105
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
106
93
|
# # │ 2001-01-01 00:10:00 ┆ 2001-01-01 00:00:00 │
|
107
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
108
94
|
# # │ 2001-01-01 00:20:00 ┆ 2001-01-01 00:00:00 │
|
109
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
110
95
|
# # │ 2001-01-01 00:30:00 ┆ 2001-01-01 00:30:00 │
|
111
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
112
96
|
# # │ 2001-01-01 00:40:00 ┆ 2001-01-01 00:30:00 │
|
113
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
114
97
|
# # │ 2001-01-01 00:50:00 ┆ 2001-01-01 00:30:00 │
|
115
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
116
98
|
# # │ 2001-01-01 01:00:00 ┆ 2001-01-01 01:00:00 │
|
117
99
|
# # └─────────────────────┴─────────────────────┘
|
118
100
|
def truncate(every, offset: nil)
|
@@ -177,17 +159,11 @@ module Polars
|
|
177
159
|
# # │ datetime[μs] │
|
178
160
|
# # ╞═════════════════════╡
|
179
161
|
# # │ 2001-01-01 00:00:00 │
|
180
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
181
162
|
# # │ 2001-01-01 03:45:00 │
|
182
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
183
163
|
# # │ 2001-01-01 07:30:00 │
|
184
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
185
164
|
# # │ 2001-01-01 11:15:00 │
|
186
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
187
165
|
# # │ 2001-01-01 15:00:00 │
|
188
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
189
166
|
# # │ 2001-01-01 18:45:00 │
|
190
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
191
167
|
# # │ 2001-01-01 22:30:00 │
|
192
168
|
# # └─────────────────────┘
|
193
169
|
#
|
@@ -201,17 +177,11 @@ module Polars
|
|
201
177
|
# # │ datetime[μs] │
|
202
178
|
# # ╞═════════════════════╡
|
203
179
|
# # │ 2001-01-01 00:00:00 │
|
204
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
205
180
|
# # │ 2001-01-01 04:00:00 │
|
206
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
207
181
|
# # │ 2001-01-01 08:00:00 │
|
208
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
209
182
|
# # │ 2001-01-01 11:00:00 │
|
210
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
211
183
|
# # │ 2001-01-01 15:00:00 │
|
212
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
213
184
|
# # │ 2001-01-01 19:00:00 │
|
214
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
215
185
|
# # │ 2001-01-01 23:00:00 │
|
216
186
|
# # └─────────────────────┘
|
217
187
|
#
|
@@ -228,17 +198,11 @@ module Polars
|
|
228
198
|
# # │ datetime[μs] ┆ datetime[μs] │
|
229
199
|
# # ╞═════════════════════╪═════════════════════╡
|
230
200
|
# # │ 2001-01-01 00:00:00 ┆ 2001-01-01 00:00:00 │
|
231
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
232
201
|
# # │ 2001-01-01 00:10:00 ┆ 2001-01-01 00:00:00 │
|
233
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
234
202
|
# # │ 2001-01-01 00:20:00 ┆ 2001-01-01 00:30:00 │
|
235
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
236
203
|
# # │ 2001-01-01 00:30:00 ┆ 2001-01-01 00:30:00 │
|
237
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
238
204
|
# # │ 2001-01-01 00:40:00 ┆ 2001-01-01 00:30:00 │
|
239
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
240
205
|
# # │ 2001-01-01 00:50:00 ┆ 2001-01-01 01:00:00 │
|
241
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
242
206
|
# # │ 2001-01-01 01:00:00 ┆ 2001-01-01 01:00:00 │
|
243
207
|
# # └─────────────────────┴─────────────────────┘
|
244
208
|
def round(every, offset: nil)
|
@@ -283,11 +247,8 @@ module Polars
|
|
283
247
|
# # │ datetime[μs] │
|
284
248
|
# # ╞═════════════════════╡
|
285
249
|
# # │ 2001-01-01 00:00:00 │
|
286
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
287
250
|
# # │ 2001-06-30 00:00:00 │
|
288
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
289
251
|
# # │ 2001-12-27 00:00:00 │
|
290
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
291
252
|
# # │ 2002-06-25 00:00:00 │
|
292
253
|
# # └─────────────────────┘
|
293
254
|
#
|
@@ -301,11 +262,8 @@ module Polars
|
|
301
262
|
# # │ i32 │
|
302
263
|
# # ╞══════╡
|
303
264
|
# # │ 2001 │
|
304
|
-
# # ├╌╌╌╌╌╌┤
|
305
265
|
# # │ 2001 │
|
306
|
-
# # ├╌╌╌╌╌╌┤
|
307
266
|
# # │ 2001 │
|
308
|
-
# # ├╌╌╌╌╌╌┤
|
309
267
|
# # │ 2002 │
|
310
268
|
# # └──────┘
|
311
269
|
def year
|
@@ -344,9 +302,7 @@ module Polars
|
|
344
302
|
# # │ datetime[μs] │
|
345
303
|
# # ╞═════════════════════╡
|
346
304
|
# # │ 2001-01-01 00:00:00 │
|
347
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
348
305
|
# # │ 2001-06-30 00:00:00 │
|
349
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
350
306
|
# # │ 2001-12-27 00:00:00 │
|
351
307
|
# # └─────────────────────┘
|
352
308
|
#
|
@@ -360,9 +316,7 @@ module Polars
|
|
360
316
|
# # │ u32 │
|
361
317
|
# # ╞══════╡
|
362
318
|
# # │ 1 │
|
363
|
-
# # ├╌╌╌╌╌╌┤
|
364
319
|
# # │ 2 │
|
365
|
-
# # ├╌╌╌╌╌╌┤
|
366
320
|
# # │ 4 │
|
367
321
|
# # └──────┘
|
368
322
|
def quarter
|
@@ -390,9 +344,7 @@ module Polars
|
|
390
344
|
# # │ datetime[μs] │
|
391
345
|
# # ╞═════════════════════╡
|
392
346
|
# # │ 2001-01-01 00:00:00 │
|
393
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
394
347
|
# # │ 2001-02-01 00:00:00 │
|
395
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
396
348
|
# # │ 2001-03-04 00:00:00 │
|
397
349
|
# # └─────────────────────┘
|
398
350
|
#
|
@@ -406,9 +358,7 @@ module Polars
|
|
406
358
|
# # │ u32 │
|
407
359
|
# # ╞══════╡
|
408
360
|
# # │ 1 │
|
409
|
-
# # ├╌╌╌╌╌╌┤
|
410
361
|
# # │ 2 │
|
411
|
-
# # ├╌╌╌╌╌╌┤
|
412
362
|
# # │ 3 │
|
413
363
|
# # └──────┘
|
414
364
|
def month
|
@@ -436,9 +386,7 @@ module Polars
|
|
436
386
|
# # │ datetime[μs] │
|
437
387
|
# # ╞═════════════════════╡
|
438
388
|
# # │ 2001-01-01 00:00:00 │
|
439
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
440
389
|
# # │ 2001-02-01 00:00:00 │
|
441
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
442
390
|
# # │ 2001-03-04 00:00:00 │
|
443
391
|
# # └─────────────────────┘
|
444
392
|
#
|
@@ -452,9 +400,7 @@ module Polars
|
|
452
400
|
# # │ u32 │
|
453
401
|
# # ╞══════╡
|
454
402
|
# # │ 1 │
|
455
|
-
# # ├╌╌╌╌╌╌┤
|
456
403
|
# # │ 5 │
|
457
|
-
# # ├╌╌╌╌╌╌┤
|
458
404
|
# # │ 9 │
|
459
405
|
# # └──────┘
|
460
406
|
def week
|
@@ -481,9 +427,7 @@ module Polars
|
|
481
427
|
# # │ datetime[μs] │
|
482
428
|
# # ╞═════════════════════╡
|
483
429
|
# # │ 2001-01-01 00:00:00 │
|
484
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
485
430
|
# # │ 2001-01-04 00:00:00 │
|
486
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
487
431
|
# # │ 2001-01-07 00:00:00 │
|
488
432
|
# # └─────────────────────┘
|
489
433
|
#
|
@@ -503,9 +447,7 @@ module Polars
|
|
503
447
|
# # │ u32 ┆ u32 ┆ u32 │
|
504
448
|
# # ╞═════════╪══════════════╪═════════════╡
|
505
449
|
# # │ 1 ┆ 1 ┆ 1 │
|
506
|
-
# # ├╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
507
450
|
# # │ 4 ┆ 4 ┆ 4 │
|
508
|
-
# # ├╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
509
451
|
# # │ 7 ┆ 7 ┆ 7 │
|
510
452
|
# # └─────────┴──────────────┴─────────────┘
|
511
453
|
def weekday
|
@@ -533,9 +475,7 @@ module Polars
|
|
533
475
|
# # │ datetime[μs] │
|
534
476
|
# # ╞═════════════════════╡
|
535
477
|
# # │ 2001-01-01 00:00:00 │
|
536
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
537
478
|
# # │ 2001-01-04 00:00:00 │
|
538
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
539
479
|
# # │ 2001-01-07 00:00:00 │
|
540
480
|
# # └─────────────────────┘
|
541
481
|
#
|
@@ -555,9 +495,7 @@ module Polars
|
|
555
495
|
# # │ u32 ┆ u32 ┆ u32 │
|
556
496
|
# # ╞═════════╪══════════════╪═════════════╡
|
557
497
|
# # │ 1 ┆ 1 ┆ 1 │
|
558
|
-
# # ├╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
559
498
|
# # │ 4 ┆ 4 ┆ 4 │
|
560
|
-
# # ├╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
561
499
|
# # │ 7 ┆ 7 ┆ 7 │
|
562
500
|
# # └─────────┴──────────────┴─────────────┘
|
563
501
|
def day
|
@@ -585,9 +523,7 @@ module Polars
|
|
585
523
|
# # │ datetime[μs] │
|
586
524
|
# # ╞═════════════════════╡
|
587
525
|
# # │ 2001-01-01 00:00:00 │
|
588
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
589
526
|
# # │ 2001-01-04 00:00:00 │
|
590
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
591
527
|
# # │ 2001-01-07 00:00:00 │
|
592
528
|
# # └─────────────────────┘
|
593
529
|
#
|
@@ -607,9 +543,7 @@ module Polars
|
|
607
543
|
# # │ u32 ┆ u32 ┆ u32 │
|
608
544
|
# # ╞═════════╪══════════════╪═════════════╡
|
609
545
|
# # │ 1 ┆ 1 ┆ 1 │
|
610
|
-
# # ├╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
611
546
|
# # │ 4 ┆ 4 ┆ 4 │
|
612
|
-
# # ├╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
613
547
|
# # │ 7 ┆ 7 ┆ 7 │
|
614
548
|
# # └─────────┴──────────────┴─────────────┘
|
615
549
|
def ordinal_day
|
@@ -636,9 +570,7 @@ module Polars
|
|
636
570
|
# # │ datetime[μs] │
|
637
571
|
# # ╞═════════════════════╡
|
638
572
|
# # │ 2001-01-01 00:00:00 │
|
639
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
640
573
|
# # │ 2001-01-01 12:00:00 │
|
641
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
642
574
|
# # │ 2001-01-02 00:00:00 │
|
643
575
|
# # └─────────────────────┘
|
644
576
|
#
|
@@ -652,9 +584,7 @@ module Polars
|
|
652
584
|
# # │ u32 │
|
653
585
|
# # ╞══════╡
|
654
586
|
# # │ 0 │
|
655
|
-
# # ├╌╌╌╌╌╌┤
|
656
587
|
# # │ 12 │
|
657
|
-
# # ├╌╌╌╌╌╌┤
|
658
588
|
# # │ 0 │
|
659
589
|
# # └──────┘
|
660
590
|
def hour
|
@@ -681,9 +611,7 @@ module Polars
|
|
681
611
|
# # │ datetime[μs] │
|
682
612
|
# # ╞═════════════════════╡
|
683
613
|
# # │ 2001-01-01 00:00:00 │
|
684
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
685
614
|
# # │ 2001-01-01 00:02:00 │
|
686
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
687
615
|
# # │ 2001-01-01 00:04:00 │
|
688
616
|
# # └─────────────────────┘
|
689
617
|
#
|
@@ -697,9 +625,7 @@ module Polars
|
|
697
625
|
# # │ u32 │
|
698
626
|
# # ╞══════╡
|
699
627
|
# # │ 0 │
|
700
|
-
# # ├╌╌╌╌╌╌┤
|
701
628
|
# # │ 2 │
|
702
|
-
# # ├╌╌╌╌╌╌┤
|
703
629
|
# # │ 4 │
|
704
630
|
# # └──────┘
|
705
631
|
def minute
|
@@ -734,9 +660,7 @@ module Polars
|
|
734
660
|
# # │ datetime[μs] │
|
735
661
|
# # ╞════════════════════════════╡
|
736
662
|
# # │ 2001-01-01 00:00:00.456789 │
|
737
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
738
663
|
# # │ 2001-01-01 00:00:03.111110 │
|
739
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
740
664
|
# # │ 2001-01-01 00:00:05.765431 │
|
741
665
|
# # └────────────────────────────┘
|
742
666
|
#
|
@@ -750,9 +674,7 @@ module Polars
|
|
750
674
|
# # │ u32 │
|
751
675
|
# # ╞══════╡
|
752
676
|
# # │ 0 │
|
753
|
-
# # ├╌╌╌╌╌╌┤
|
754
677
|
# # │ 3 │
|
755
|
-
# # ├╌╌╌╌╌╌┤
|
756
678
|
# # │ 5 │
|
757
679
|
# # └──────┘
|
758
680
|
#
|
@@ -765,9 +687,7 @@ module Polars
|
|
765
687
|
# # │ f64 │
|
766
688
|
# # ╞══════════╡
|
767
689
|
# # │ 0.456789 │
|
768
|
-
# # ├╌╌╌╌╌╌╌╌╌╌┤
|
769
690
|
# # │ 3.11111 │
|
770
|
-
# # ├╌╌╌╌╌╌╌╌╌╌┤
|
771
691
|
# # │ 5.765431 │
|
772
692
|
# # └──────────┘
|
773
693
|
#
|
@@ -785,9 +705,7 @@ module Polars
|
|
785
705
|
# # │ datetime[μs] │
|
786
706
|
# # ╞═════════════════════╡
|
787
707
|
# # │ 2001-01-01 00:00:00 │
|
788
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
789
708
|
# # │ 2001-01-01 00:00:02 │
|
790
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
791
709
|
# # │ 2001-01-01 00:00:04 │
|
792
710
|
# # └─────────────────────┘
|
793
711
|
#
|
@@ -801,9 +719,7 @@ module Polars
|
|
801
719
|
# # │ u32 │
|
802
720
|
# # ╞══════╡
|
803
721
|
# # │ 0 │
|
804
|
-
# # ├╌╌╌╌╌╌┤
|
805
722
|
# # │ 2 │
|
806
|
-
# # ├╌╌╌╌╌╌┤
|
807
723
|
# # │ 4 │
|
808
724
|
# # └──────┘
|
809
725
|
def second(fractional: false)
|
@@ -868,9 +784,7 @@ module Polars
|
|
868
784
|
# # │ datetime[μs] ┆ i64 ┆ i64 │
|
869
785
|
# # ╞═════════════════════╪═════════════════╪═══════════╡
|
870
786
|
# # │ 2001-01-01 00:00:00 ┆ 978307200000000 ┆ 978307200 │
|
871
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┤
|
872
787
|
# # │ 2001-01-02 00:00:00 ┆ 978393600000000 ┆ 978393600 │
|
873
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┤
|
874
788
|
# # │ 2001-01-03 00:00:00 ┆ 978480000000000 ┆ 978480000 │
|
875
789
|
# # └─────────────────────┴─────────────────┴───────────┘
|
876
790
|
def epoch(tu = "us")
|
@@ -911,9 +825,7 @@ module Polars
|
|
911
825
|
# # │ datetime[μs] ┆ i64 ┆ i64 │
|
912
826
|
# # ╞═════════════════════╪═════════════════╪══════════════╡
|
913
827
|
# # │ 2001-01-01 00:00:00 ┆ 978307200000000 ┆ 978307200000 │
|
914
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
915
828
|
# # │ 2001-01-02 00:00:00 ┆ 978393600000000 ┆ 978393600000 │
|
916
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
917
829
|
# # │ 2001-01-03 00:00:00 ┆ 978480000000000 ┆ 978480000000 │
|
918
830
|
# # └─────────────────────┴─────────────────┴──────────────┘
|
919
831
|
def timestamp(tu = "us")
|
@@ -952,9 +864,7 @@ module Polars
|
|
952
864
|
# # │ datetime[ns] ┆ datetime[μs] │
|
953
865
|
# # ╞═════════════════════╪═══════════════════════╡
|
954
866
|
# # │ 2001-01-01 00:00:00 ┆ +32971-04-28 00:00:00 │
|
955
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
956
867
|
# # │ 2001-01-02 00:00:00 ┆ +32974-01-22 00:00:00 │
|
957
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
958
868
|
# # │ 2001-01-03 00:00:00 ┆ +32976-10-18 00:00:00 │
|
959
869
|
# # └─────────────────────┴───────────────────────┘
|
960
870
|
def with_time_unit(tu)
|
@@ -991,9 +901,7 @@ module Polars
|
|
991
901
|
# # │ datetime[μs] ┆ datetime[ms] ┆ datetime[ns] │
|
992
902
|
# # ╞═════════════════════╪═════════════════════╪═════════════════════╡
|
993
903
|
# # │ 2001-01-01 00:00:00 ┆ 2001-01-01 00:00:00 ┆ 2001-01-01 00:00:00 │
|
994
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
995
904
|
# # │ 2001-01-02 00:00:00 ┆ 2001-01-02 00:00:00 ┆ 2001-01-02 00:00:00 │
|
996
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
997
905
|
# # │ 2001-01-03 00:00:00 ┆ 2001-01-03 00:00:00 ┆ 2001-01-03 00:00:00 │
|
998
906
|
# # └─────────────────────┴─────────────────────┴─────────────────────┘
|
999
907
|
def cast_time_unit(tu)
|
@@ -1011,7 +919,10 @@ module Polars
|
|
1011
919
|
# df = Polars::DataFrame.new(
|
1012
920
|
# {
|
1013
921
|
# "date" => Polars.date_range(
|
1014
|
-
# DateTime.new(2020, 3, 1),
|
922
|
+
# DateTime.new(2020, 3, 1),
|
923
|
+
# DateTime.new(2020, 5, 1),
|
924
|
+
# "1mo",
|
925
|
+
# time_zone: "UTC"
|
1015
926
|
# )
|
1016
927
|
# }
|
1017
928
|
# )
|
@@ -1019,38 +930,36 @@ module Polars
|
|
1019
930
|
# [
|
1020
931
|
# Polars.col("date"),
|
1021
932
|
# Polars.col("date")
|
1022
|
-
# .dt.
|
933
|
+
# .dt.convert_time_zone("Europe/London")
|
1023
934
|
# .alias("London")
|
1024
935
|
# ]
|
1025
936
|
# )
|
1026
937
|
# # =>
|
1027
938
|
# # shape: (3, 2)
|
1028
|
-
# #
|
1029
|
-
# # │ date
|
1030
|
-
# # │ ---
|
1031
|
-
# # │ datetime[μs]
|
1032
|
-
# #
|
1033
|
-
# # │ 2020-03-01 00:00:00 ┆ 2020-03-01 00:00:00 GMT │
|
1034
|
-
# #
|
1035
|
-
# # │ 2020-
|
1036
|
-
# #
|
1037
|
-
|
1038
|
-
|
1039
|
-
def with_time_zone(tz)
|
1040
|
-
Utils.wrap_expr(_rbexpr.dt_with_time_zone(tz))
|
939
|
+
# # ┌─────────────────────────┬─────────────────────────────┐
|
940
|
+
# # │ date ┆ London │
|
941
|
+
# # │ --- ┆ --- │
|
942
|
+
# # │ datetime[μs, UTC] ┆ datetime[μs, Europe/London] │
|
943
|
+
# # ╞═════════════════════════╪═════════════════════════════╡
|
944
|
+
# # │ 2020-03-01 00:00:00 UTC ┆ 2020-03-01 00:00:00 GMT │
|
945
|
+
# # │ 2020-04-01 00:00:00 UTC ┆ 2020-04-01 01:00:00 BST │
|
946
|
+
# # │ 2020-05-01 00:00:00 UTC ┆ 2020-05-01 01:00:00 BST │
|
947
|
+
# # └─────────────────────────┴─────────────────────────────┘
|
948
|
+
def convert_time_zone(tz)
|
949
|
+
Utils.wrap_expr(_rbexpr.dt_convert_time_zone(tz))
|
1041
950
|
end
|
1042
951
|
|
1043
952
|
# Cast time zone for a Series of type Datetime.
|
1044
953
|
#
|
1045
|
-
# Different from `
|
954
|
+
# Different from `convert_time_zone`, this will also modify
|
1046
955
|
# the underlying timestamp,
|
1047
956
|
#
|
1048
957
|
# @param tz [String]
|
1049
958
|
# Time zone for the `Datetime` Series.
|
1050
959
|
#
|
1051
960
|
# @return [Expr]
|
1052
|
-
def
|
1053
|
-
Utils.wrap_expr(_rbexpr.
|
961
|
+
def replace_time_zone(tz)
|
962
|
+
Utils.wrap_expr(_rbexpr.dt_replace_time_zone(tz))
|
1054
963
|
end
|
1055
964
|
|
1056
965
|
# Localize tz-naive Datetime Series to tz-aware Datetime Series.
|
@@ -1092,9 +1001,7 @@ module Polars
|
|
1092
1001
|
# # │ datetime[μs] ┆ i64 │
|
1093
1002
|
# # ╞═════════════════════╪═══════════╡
|
1094
1003
|
# # │ 2020-03-01 00:00:00 ┆ null │
|
1095
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┤
|
1096
1004
|
# # │ 2020-04-01 00:00:00 ┆ 31 │
|
1097
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┤
|
1098
1005
|
# # │ 2020-05-01 00:00:00 ┆ 30 │
|
1099
1006
|
# # └─────────────────────┴───────────┘
|
1100
1007
|
def days
|
@@ -1127,11 +1034,8 @@ module Polars
|
|
1127
1034
|
# # │ datetime[μs] ┆ i64 │
|
1128
1035
|
# # ╞═════════════════════╪════════════╡
|
1129
1036
|
# # │ 2020-01-01 00:00:00 ┆ null │
|
1130
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┤
|
1131
1037
|
# # │ 2020-01-02 00:00:00 ┆ 24 │
|
1132
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┤
|
1133
1038
|
# # │ 2020-01-03 00:00:00 ┆ 24 │
|
1134
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┤
|
1135
1039
|
# # │ 2020-01-04 00:00:00 ┆ 24 │
|
1136
1040
|
# # └─────────────────────┴────────────┘
|
1137
1041
|
def hours
|
@@ -1164,11 +1068,8 @@ module Polars
|
|
1164
1068
|
# # │ datetime[μs] ┆ i64 │
|
1165
1069
|
# # ╞═════════════════════╪══════════════╡
|
1166
1070
|
# # │ 2020-01-01 00:00:00 ┆ null │
|
1167
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
1168
1071
|
# # │ 2020-01-02 00:00:00 ┆ 1440 │
|
1169
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
1170
1072
|
# # │ 2020-01-03 00:00:00 ┆ 1440 │
|
1171
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
1172
1073
|
# # │ 2020-01-04 00:00:00 ┆ 1440 │
|
1173
1074
|
# # └─────────────────────┴──────────────┘
|
1174
1075
|
def minutes
|
@@ -1201,13 +1102,9 @@ module Polars
|
|
1201
1102
|
# # │ datetime[μs] ┆ i64 │
|
1202
1103
|
# # ╞═════════════════════╪══════════════╡
|
1203
1104
|
# # │ 2020-01-01 00:00:00 ┆ null │
|
1204
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
1205
1105
|
# # │ 2020-01-01 00:01:00 ┆ 60 │
|
1206
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
1207
1106
|
# # │ 2020-01-01 00:02:00 ┆ 60 │
|
1208
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
1209
1107
|
# # │ 2020-01-01 00:03:00 ┆ 60 │
|
1210
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
1211
1108
|
# # │ 2020-01-01 00:04:00 ┆ 60 │
|
1212
1109
|
# # └─────────────────────┴──────────────┘
|
1213
1110
|
def seconds
|
@@ -1240,21 +1137,13 @@ module Polars
|
|
1240
1137
|
# # │ datetime[μs] ┆ i64 │
|
1241
1138
|
# # ╞═════════════════════════╪═══════════════════╡
|
1242
1139
|
# # │ 2020-01-01 00:00:00 ┆ null │
|
1243
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
1244
1140
|
# # │ 2020-01-01 00:00:00.001 ┆ 1 │
|
1245
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
1246
1141
|
# # │ 2020-01-01 00:00:00.002 ┆ 1 │
|
1247
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
1248
1142
|
# # │ 2020-01-01 00:00:00.003 ┆ 1 │
|
1249
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
1250
1143
|
# # │ ... ┆ ... │
|
1251
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
1252
1144
|
# # │ 2020-01-01 00:00:00.997 ┆ 1 │
|
1253
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
1254
1145
|
# # │ 2020-01-01 00:00:00.998 ┆ 1 │
|
1255
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
1256
1146
|
# # │ 2020-01-01 00:00:00.999 ┆ 1 │
|
1257
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
1258
1147
|
# # │ 2020-01-01 00:00:01 ┆ 1 │
|
1259
1148
|
# # └─────────────────────────┴───────────────────┘
|
1260
1149
|
def milliseconds
|
@@ -1287,21 +1176,13 @@ module Polars
|
|
1287
1176
|
# # │ datetime[μs] ┆ i64 │
|
1288
1177
|
# # ╞═════════════════════════╪═══════════════════╡
|
1289
1178
|
# # │ 2020-01-01 00:00:00 ┆ null │
|
1290
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
1291
1179
|
# # │ 2020-01-01 00:00:00.001 ┆ 1000 │
|
1292
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
1293
1180
|
# # │ 2020-01-01 00:00:00.002 ┆ 1000 │
|
1294
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
1295
1181
|
# # │ 2020-01-01 00:00:00.003 ┆ 1000 │
|
1296
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
1297
1182
|
# # │ ... ┆ ... │
|
1298
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
1299
1183
|
# # │ 2020-01-01 00:00:00.997 ┆ 1000 │
|
1300
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
1301
1184
|
# # │ 2020-01-01 00:00:00.998 ┆ 1000 │
|
1302
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
1303
1185
|
# # │ 2020-01-01 00:00:00.999 ┆ 1000 │
|
1304
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
1305
1186
|
# # │ 2020-01-01 00:00:01 ┆ 1000 │
|
1306
1187
|
# # └─────────────────────────┴───────────────────┘
|
1307
1188
|
def microseconds
|
@@ -1334,21 +1215,13 @@ module Polars
|
|
1334
1215
|
# # │ datetime[μs] ┆ i64 │
|
1335
1216
|
# # ╞═════════════════════════╪══════════════════╡
|
1336
1217
|
# # │ 2020-01-01 00:00:00 ┆ null │
|
1337
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
1338
1218
|
# # │ 2020-01-01 00:00:00.001 ┆ 1000000 │
|
1339
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
1340
1219
|
# # │ 2020-01-01 00:00:00.002 ┆ 1000000 │
|
1341
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
1342
1220
|
# # │ 2020-01-01 00:00:00.003 ┆ 1000000 │
|
1343
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
1344
1221
|
# # │ ... ┆ ... │
|
1345
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
1346
1222
|
# # │ 2020-01-01 00:00:00.997 ┆ 1000000 │
|
1347
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
1348
1223
|
# # │ 2020-01-01 00:00:00.998 ┆ 1000000 │
|
1349
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
1350
1224
|
# # │ 2020-01-01 00:00:00.999 ┆ 1000000 │
|
1351
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
1352
1225
|
# # │ 2020-01-01 00:00:01 ┆ 1000000 │
|
1353
1226
|
# # └─────────────────────────┴──────────────────┘
|
1354
1227
|
def nanoseconds
|
@@ -1400,15 +1273,10 @@ module Polars
|
|
1400
1273
|
# # │ datetime[μs] ┆ datetime[μs] │
|
1401
1274
|
# # ╞═════════════════════╪═════════════════════╡
|
1402
1275
|
# # │ 2001-01-01 00:00:00 ┆ 1998-11-01 00:00:00 │
|
1403
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
1404
1276
|
# # │ 2002-01-01 00:00:00 ┆ 1999-11-01 00:00:00 │
|
1405
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
1406
1277
|
# # │ 2003-01-01 00:00:00 ┆ 2000-11-01 00:00:00 │
|
1407
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
1408
1278
|
# # │ 2004-01-01 00:00:00 ┆ 2001-11-01 00:00:00 │
|
1409
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
1410
1279
|
# # │ 2005-01-01 00:00:00 ┆ 2002-11-01 00:00:00 │
|
1411
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
1412
1280
|
# # │ 2006-01-01 00:00:00 ┆ 2003-11-01 00:00:00 │
|
1413
1281
|
# # └─────────────────────┴─────────────────────┘
|
1414
1282
|
def offset_by(by)
|