polars-df 0.2.5-x86_64-linux → 0.3.1-x86_64-linux
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/LICENSE-THIRD-PARTY.txt +1354 -740
- data/README.md +40 -2
- data/lib/polars/3.0/polars.so +0 -0
- data/lib/polars/3.1/polars.so +0 -0
- data/lib/polars/3.2/polars.so +0 -0
- 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 +3 -2
data/lib/polars/string_expr.rb
CHANGED
@@ -22,6 +22,9 @@ module Polars
|
|
22
22
|
# @param exact [Boolean]
|
23
23
|
# - If true, require an exact format match.
|
24
24
|
# - If false, allow the format to match anywhere in the target string.
|
25
|
+
# @param utc [Boolean]
|
26
|
+
# Parse timezone aware datetimes as UTC. This may be useful if you have data
|
27
|
+
# with mixed offsets.
|
25
28
|
#
|
26
29
|
# @return [Expr]
|
27
30
|
#
|
@@ -57,14 +60,11 @@ module Polars
|
|
57
60
|
# # │ date │
|
58
61
|
# # ╞════════════╡
|
59
62
|
# # │ 2021-04-22 │
|
60
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌┤
|
61
63
|
# # │ 2022-01-04 │
|
62
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌┤
|
63
64
|
# # │ 2022-01-31 │
|
64
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌┤
|
65
65
|
# # │ 2001-07-08 │
|
66
66
|
# # └────────────┘
|
67
|
-
def strptime(datatype, fmt = nil, strict: true, exact: true, cache: true, tz_aware: false)
|
67
|
+
def strptime(datatype, fmt = nil, strict: true, exact: true, cache: true, tz_aware: false, utc: false)
|
68
68
|
if !Utils.is_polars_dtype(datatype)
|
69
69
|
raise ArgumentError, "expected: {DataType} got: #{datatype}"
|
70
70
|
end
|
@@ -74,7 +74,7 @@ module Polars
|
|
74
74
|
elsif datatype == :datetime
|
75
75
|
# TODO fix
|
76
76
|
tu = nil # datatype.tu
|
77
|
-
dtcol = Utils.wrap_expr(_rbexpr.str_parse_datetime(fmt, strict, exact, cache, tz_aware))
|
77
|
+
dtcol = Utils.wrap_expr(_rbexpr.str_parse_datetime(fmt, strict, exact, cache, tz_aware, utc))
|
78
78
|
if tu.nil?
|
79
79
|
dtcol
|
80
80
|
else
|
@@ -111,11 +111,8 @@ module Polars
|
|
111
111
|
# # │ str ┆ u32 ┆ u32 │
|
112
112
|
# # ╞══════╪════════╪════════╡
|
113
113
|
# # │ Café ┆ 5 ┆ 4 │
|
114
|
-
# # ├╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤
|
115
114
|
# # │ null ┆ null ┆ null │
|
116
|
-
# # ├╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤
|
117
115
|
# # │ 345 ┆ 3 ┆ 3 │
|
118
|
-
# # ├╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤
|
119
116
|
# # │ 東京 ┆ 6 ┆ 2 │
|
120
117
|
# # └──────┴────────┴────────┘
|
121
118
|
def lengths
|
@@ -146,11 +143,8 @@ module Polars
|
|
146
143
|
# # │ str ┆ u32 ┆ u32 │
|
147
144
|
# # ╞══════╪════════╪════════╡
|
148
145
|
# # │ Café ┆ 5 ┆ 4 │
|
149
|
-
# # ├╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤
|
150
146
|
# # │ null ┆ null ┆ null │
|
151
|
-
# # ├╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤
|
152
147
|
# # │ 345 ┆ 3 ┆ 3 │
|
153
|
-
# # ├╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤
|
154
148
|
# # │ 東京 ┆ 6 ┆ 2 │
|
155
149
|
# # └──────┴────────┴────────┘
|
156
150
|
def n_chars
|
@@ -195,7 +189,6 @@ module Polars
|
|
195
189
|
# # │ str │
|
196
190
|
# # ╞═════╡
|
197
191
|
# # │ CAT │
|
198
|
-
# # ├╌╌╌╌╌┤
|
199
192
|
# # │ DOG │
|
200
193
|
# # └─────┘
|
201
194
|
def to_uppercase
|
@@ -217,7 +210,6 @@ module Polars
|
|
217
210
|
# # │ str │
|
218
211
|
# # ╞═════╡
|
219
212
|
# # │ cat │
|
220
|
-
# # ├╌╌╌╌╌┤
|
221
213
|
# # │ dog │
|
222
214
|
# # └─────┘
|
223
215
|
def to_lowercase
|
@@ -242,9 +234,7 @@ module Polars
|
|
242
234
|
# # │ str │
|
243
235
|
# # ╞═══════╡
|
244
236
|
# # │ lead │
|
245
|
-
# # ├╌╌╌╌╌╌╌┤
|
246
237
|
# # │ trail │
|
247
|
-
# # ├╌╌╌╌╌╌╌┤
|
248
238
|
# # │ both │
|
249
239
|
# # └───────┘
|
250
240
|
def strip(matches = nil)
|
@@ -272,9 +262,7 @@ module Polars
|
|
272
262
|
# # │ str │
|
273
263
|
# # ╞════════╡
|
274
264
|
# # │ lead │
|
275
|
-
# # ├╌╌╌╌╌╌╌╌┤
|
276
265
|
# # │ trail │
|
277
|
-
# # ├╌╌╌╌╌╌╌╌┤
|
278
266
|
# # │ both │
|
279
267
|
# # └────────┘
|
280
268
|
def lstrip(matches = nil)
|
@@ -302,9 +290,7 @@ module Polars
|
|
302
290
|
# # │ str │
|
303
291
|
# # ╞═══════╡
|
304
292
|
# # │ lead │
|
305
|
-
# # ├╌╌╌╌╌╌╌┤
|
306
293
|
# # │ trail │
|
307
|
-
# # ├╌╌╌╌╌╌╌┤
|
308
294
|
# # │ both │
|
309
295
|
# # └───────┘
|
310
296
|
def rstrip(matches = nil)
|
@@ -343,21 +329,13 @@ module Polars
|
|
343
329
|
# # │ str │
|
344
330
|
# # ╞═════════╡
|
345
331
|
# # │ -0010 │
|
346
|
-
# # ├╌╌╌╌╌╌╌╌╌┤
|
347
332
|
# # │ -0001 │
|
348
|
-
# # ├╌╌╌╌╌╌╌╌╌┤
|
349
333
|
# # │ 00000 │
|
350
|
-
# # ├╌╌╌╌╌╌╌╌╌┤
|
351
334
|
# # │ 00001 │
|
352
|
-
# # ├╌╌╌╌╌╌╌╌╌┤
|
353
335
|
# # │ ... │
|
354
|
-
# # ├╌╌╌╌╌╌╌╌╌┤
|
355
336
|
# # │ 10000 │
|
356
|
-
# # ├╌╌╌╌╌╌╌╌╌┤
|
357
337
|
# # │ 100000 │
|
358
|
-
# # ├╌╌╌╌╌╌╌╌╌┤
|
359
338
|
# # │ 1000000 │
|
360
|
-
# # ├╌╌╌╌╌╌╌╌╌┤
|
361
339
|
# # │ null │
|
362
340
|
# # └─────────┘
|
363
341
|
def zfill(alignment)
|
@@ -388,11 +366,8 @@ module Polars
|
|
388
366
|
# # │ str │
|
389
367
|
# # ╞══════════════╡
|
390
368
|
# # │ cow***** │
|
391
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
392
369
|
# # │ monkey** │
|
393
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
394
370
|
# # │ null │
|
395
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
396
371
|
# # │ hippopotamus │
|
397
372
|
# # └──────────────┘
|
398
373
|
def ljust(width, fillchar = " ")
|
@@ -423,11 +398,8 @@ module Polars
|
|
423
398
|
# # │ str │
|
424
399
|
# # ╞══════════════╡
|
425
400
|
# # │ *****cow │
|
426
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
427
401
|
# # │ **monkey │
|
428
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
429
402
|
# # │ null │
|
430
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
431
403
|
# # │ hippopotamus │
|
432
404
|
# # └──────────────┘
|
433
405
|
def rjust(width, fillchar = " ")
|
@@ -460,15 +432,13 @@ module Polars
|
|
460
432
|
# # │ str ┆ bool ┆ bool │
|
461
433
|
# # ╞═════════════╪═══════╪═════════╡
|
462
434
|
# # │ Crab ┆ false ┆ false │
|
463
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┤
|
464
435
|
# # │ cat and dog ┆ true ┆ false │
|
465
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┤
|
466
436
|
# # │ rab$bit ┆ true ┆ true │
|
467
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┤
|
468
437
|
# # │ null ┆ null ┆ null │
|
469
438
|
# # └─────────────┴───────┴─────────┘
|
470
|
-
def contains(pattern, literal: false)
|
471
|
-
Utils.
|
439
|
+
def contains(pattern, literal: false, strict: true)
|
440
|
+
pattern = Utils.expr_to_lit_or_expr(pattern, str_to_lit: true)._rbexpr
|
441
|
+
Utils.wrap_expr(_rbexpr.str_contains(pattern, literal, strict))
|
472
442
|
end
|
473
443
|
|
474
444
|
# Check if string values end with a substring.
|
@@ -491,9 +461,7 @@ module Polars
|
|
491
461
|
# # │ str ┆ bool │
|
492
462
|
# # ╞════════╪════════════╡
|
493
463
|
# # │ apple ┆ false │
|
494
|
-
# # ├╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┤
|
495
464
|
# # │ mango ┆ true │
|
496
|
-
# # ├╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┤
|
497
465
|
# # │ null ┆ null │
|
498
466
|
# # └────────┴────────────┘
|
499
467
|
#
|
@@ -509,6 +477,7 @@ module Polars
|
|
509
477
|
# # │ mango │
|
510
478
|
# # └────────┘
|
511
479
|
def ends_with(sub)
|
480
|
+
sub = Utils.expr_to_lit_or_expr(sub, str_to_lit: true)._rbexpr
|
512
481
|
Utils.wrap_expr(_rbexpr.str_ends_with(sub))
|
513
482
|
end
|
514
483
|
|
@@ -532,9 +501,7 @@ module Polars
|
|
532
501
|
# # │ str ┆ bool │
|
533
502
|
# # ╞════════╪════════════╡
|
534
503
|
# # │ apple ┆ true │
|
535
|
-
# # ├╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┤
|
536
504
|
# # │ mango ┆ false │
|
537
|
-
# # ├╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌┤
|
538
505
|
# # │ null ┆ null │
|
539
506
|
# # └────────┴────────────┘
|
540
507
|
#
|
@@ -550,6 +517,7 @@ module Polars
|
|
550
517
|
# # │ apple │
|
551
518
|
# # └────────┘
|
552
519
|
def starts_with(sub)
|
520
|
+
sub = Utils.expr_to_lit_or_expr(sub, str_to_lit: true)._rbexpr
|
553
521
|
Utils.wrap_expr(_rbexpr.str_starts_with(sub))
|
554
522
|
end
|
555
523
|
|
@@ -579,13 +547,9 @@ module Polars
|
|
579
547
|
# # │ str │
|
580
548
|
# # ╞══════════╡
|
581
549
|
# # │ 1 │
|
582
|
-
# # ├╌╌╌╌╌╌╌╌╌╌┤
|
583
550
|
# # │ null │
|
584
|
-
# # ├╌╌╌╌╌╌╌╌╌╌┤
|
585
551
|
# # │ 2 │
|
586
|
-
# # ├╌╌╌╌╌╌╌╌╌╌┤
|
587
552
|
# # │ 2.1 │
|
588
|
-
# # ├╌╌╌╌╌╌╌╌╌╌┤
|
589
553
|
# # │ true │
|
590
554
|
# # └──────────┘
|
591
555
|
def json_path_match(json_path)
|
@@ -609,18 +573,16 @@ module Polars
|
|
609
573
|
# df.select(Polars.col("encoded").str.decode("hex"))
|
610
574
|
# # =>
|
611
575
|
# # shape: (3, 1)
|
612
|
-
# #
|
613
|
-
# # │ encoded
|
614
|
-
# # │ ---
|
615
|
-
# # │
|
616
|
-
# #
|
617
|
-
# # │
|
618
|
-
# #
|
619
|
-
# # │
|
620
|
-
# #
|
621
|
-
|
622
|
-
# # └─────────┘
|
623
|
-
def decode(encoding, strict: false)
|
576
|
+
# # ┌───────────────┐
|
577
|
+
# # │ encoded │
|
578
|
+
# # │ --- │
|
579
|
+
# # │ binary │
|
580
|
+
# # ╞═══════════════╡
|
581
|
+
# # │ [binary data] │
|
582
|
+
# # │ [binary data] │
|
583
|
+
# # │ null │
|
584
|
+
# # └───────────────┘
|
585
|
+
def decode(encoding, strict: true)
|
624
586
|
if encoding == "hex"
|
625
587
|
Utils.wrap_expr(_rbexpr.str_hex_decode(strict))
|
626
588
|
elsif encoding == "base64"
|
@@ -648,9 +610,7 @@ module Polars
|
|
648
610
|
# # │ str │
|
649
611
|
# # ╞═════════╡
|
650
612
|
# # │ 666f6f │
|
651
|
-
# # ├╌╌╌╌╌╌╌╌╌┤
|
652
613
|
# # │ 626172 │
|
653
|
-
# # ├╌╌╌╌╌╌╌╌╌┤
|
654
614
|
# # │ null │
|
655
615
|
# # └─────────┘
|
656
616
|
def encode(encoding)
|
@@ -689,7 +649,6 @@ module Polars
|
|
689
649
|
# # │ str │
|
690
650
|
# # ╞═════╡
|
691
651
|
# # │ 123 │
|
692
|
-
# # ├╌╌╌╌╌┤
|
693
652
|
# # │ 678 │
|
694
653
|
# # └─────┘
|
695
654
|
def extract(pattern, group_index: 1)
|
@@ -721,7 +680,6 @@ module Polars
|
|
721
680
|
# # │ list[str] │
|
722
681
|
# # ╞════════════════╡
|
723
682
|
# # │ ["123", "45"] │
|
724
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
725
683
|
# # │ ["678", "910"] │
|
726
684
|
# # └────────────────┘
|
727
685
|
def extract_all(pattern)
|
@@ -751,7 +709,6 @@ module Polars
|
|
751
709
|
# # │ u32 │
|
752
710
|
# # ╞══════════════╡
|
753
711
|
# # │ 5 │
|
754
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
755
712
|
# # │ 6 │
|
756
713
|
# # └──────────────┘
|
757
714
|
def count_match(pattern)
|
@@ -778,9 +735,7 @@ module Polars
|
|
778
735
|
# # │ list[str] │
|
779
736
|
# # ╞═══════════════════════╡
|
780
737
|
# # │ ["foo", "bar"] │
|
781
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
782
738
|
# # │ ["foo-bar"] │
|
783
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
784
739
|
# # │ ["foo", "bar", "baz"] │
|
785
740
|
# # └───────────────────────┘
|
786
741
|
def split(by, inclusive: false)
|
@@ -821,11 +776,8 @@ module Polars
|
|
821
776
|
# # │ struct[2] │
|
822
777
|
# # ╞═════════════╡
|
823
778
|
# # │ {"a","1"} │
|
824
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
825
779
|
# # │ {null,null} │
|
826
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
827
780
|
# # │ {"c",null} │
|
828
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
829
781
|
# # │ {"d","4"} │
|
830
782
|
# # └─────────────┘
|
831
783
|
def split_exact(by, n, inclusive: false)
|
@@ -860,11 +812,8 @@ module Polars
|
|
860
812
|
# # │ struct[2] │
|
861
813
|
# # ╞═══════════════════╡
|
862
814
|
# # │ {"foo","bar"} │
|
863
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
864
815
|
# # │ {null,null} │
|
865
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
866
816
|
# # │ {"foo-bar",null} │
|
867
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
868
817
|
# # │ {"foo","bar baz"} │
|
869
818
|
# # └───────────────────┘
|
870
819
|
def splitn(by, n)
|
@@ -895,7 +844,6 @@ module Polars
|
|
895
844
|
# # │ i64 ┆ str │
|
896
845
|
# # ╞═════╪════════╡
|
897
846
|
# # │ 1 ┆ 123ABC │
|
898
|
-
# # ├╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤
|
899
847
|
# # │ 2 ┆ abc456 │
|
900
848
|
# # └─────┴────────┘
|
901
849
|
def replace(pattern, value, literal: false)
|
@@ -926,7 +874,6 @@ module Polars
|
|
926
874
|
# # │ i64 ┆ str │
|
927
875
|
# # ╞═════╪═════════╡
|
928
876
|
# # │ 1 ┆ -bc-bc │
|
929
|
-
# # ├╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┤
|
930
877
|
# # │ 2 ┆ 123-123 │
|
931
878
|
# # └─────┴─────────┘
|
932
879
|
def replace_all(pattern, value, literal: false)
|
@@ -958,11 +905,8 @@ module Polars
|
|
958
905
|
# # │ str ┆ str │
|
959
906
|
# # ╞═════════════╪══════════╡
|
960
907
|
# # │ pear ┆ ear │
|
961
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┤
|
962
908
|
# # │ null ┆ null │
|
963
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┤
|
964
909
|
# # │ papaya ┆ aya │
|
965
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┤
|
966
910
|
# # │ dragonfruit ┆ uit │
|
967
911
|
# # └─────────────┴──────────┘
|
968
912
|
def slice(offset, length = nil)
|
@@ -53,14 +53,11 @@ module Polars
|
|
53
53
|
# # │ date │
|
54
54
|
# # ╞════════════╡
|
55
55
|
# # │ 2021-04-22 │
|
56
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌┤
|
57
56
|
# # │ 2022-01-04 │
|
58
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌┤
|
59
57
|
# # │ 2022-01-31 │
|
60
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌┤
|
61
58
|
# # │ 2001-07-08 │
|
62
59
|
# # └────────────┘
|
63
|
-
def strptime(datatype, fmt = nil, strict: true, exact: true, cache: true, tz_aware: false)
|
60
|
+
def strptime(datatype, fmt = nil, strict: true, exact: true, cache: true, tz_aware: false, utc: false)
|
64
61
|
super
|
65
62
|
end
|
66
63
|
|
@@ -224,10 +221,10 @@ module Polars
|
|
224
221
|
# s.str.decode("hex")
|
225
222
|
# # =>
|
226
223
|
# # shape: (3,)
|
227
|
-
# # Series: '' [
|
224
|
+
# # Series: '' [binary]
|
228
225
|
# # [
|
229
|
-
# #
|
230
|
-
# #
|
226
|
+
# # [binary data]
|
227
|
+
# # [binary data]
|
231
228
|
# # null
|
232
229
|
# # ]
|
233
230
|
def decode(encoding, strict: false)
|
@@ -310,7 +307,6 @@ module Polars
|
|
310
307
|
# # │ str │
|
311
308
|
# # ╞═════╡
|
312
309
|
# # │ 123 │
|
313
|
-
# # ├╌╌╌╌╌┤
|
314
310
|
# # │ 678 │
|
315
311
|
# # └─────┘
|
316
312
|
def extract(pattern, group_index: 1)
|
@@ -332,7 +328,7 @@ module Polars
|
|
332
328
|
# s.str.extract_all('(\d+)')
|
333
329
|
# # =>
|
334
330
|
# # shape: (2,)
|
335
|
-
# # Series: 'foo' [list]
|
331
|
+
# # Series: 'foo' [list[str]]
|
336
332
|
# # [
|
337
333
|
# # ["123", "45"]
|
338
334
|
# # ["678", "910"]
|
@@ -417,11 +413,8 @@ module Polars
|
|
417
413
|
# # │ str ┆ str │
|
418
414
|
# # ╞════════════╪═════════════╡
|
419
415
|
# # │ a ┆ 1 │
|
420
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
421
416
|
# # │ null ┆ null │
|
422
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
423
417
|
# # │ c ┆ null │
|
424
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
425
418
|
# # │ d ┆ 4 │
|
426
419
|
# # └────────────┴─────────────┘
|
427
420
|
def split_exact(by, n, inclusive: false)
|
@@ -469,11 +462,8 @@ module Polars
|
|
469
462
|
# # │ str ┆ str │
|
470
463
|
# # ╞════════════╪═════════════╡
|
471
464
|
# # │ foo ┆ bar │
|
472
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
473
465
|
# # │ null ┆ null │
|
474
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
475
466
|
# # │ foo-bar ┆ null │
|
476
|
-
# # ├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌┤
|
477
467
|
# # │ foo ┆ bar baz │
|
478
468
|
# # └────────────┴─────────────┘
|
479
469
|
def splitn(by, n)
|
data/lib/polars/struct_expr.rb
CHANGED
@@ -51,7 +51,6 @@ module Polars
|
|
51
51
|
# # │ str │
|
52
52
|
# # ╞═════╡
|
53
53
|
# # │ a │
|
54
|
-
# # ├╌╌╌╌╌┤
|
55
54
|
# # │ b │
|
56
55
|
# # └─────┘
|
57
56
|
def field(name)
|
@@ -90,7 +89,6 @@ module Polars
|
|
90
89
|
# # │ i64 │
|
91
90
|
# # ╞═════╡
|
92
91
|
# # │ 1 │
|
93
|
-
# # ├╌╌╌╌╌┤
|
94
92
|
# # │ 2 │
|
95
93
|
# # └─────┘
|
96
94
|
def rename_fields(names)
|
data/lib/polars/version.rb
CHANGED
data/lib/polars.rb
CHANGED
@@ -15,6 +15,7 @@ require_relative "polars/batched_csv_reader"
|
|
15
15
|
require_relative "polars/cat_expr"
|
16
16
|
require_relative "polars/cat_name_space"
|
17
17
|
require_relative "polars/convert"
|
18
|
+
require_relative "polars/plot"
|
18
19
|
require_relative "polars/data_frame"
|
19
20
|
require_relative "polars/data_types"
|
20
21
|
require_relative "polars/date_time_expr"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: polars-df
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: x86_64-linux
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-02-
|
11
|
+
date: 2023-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: andrew@ankane.org
|
@@ -49,6 +49,7 @@ files:
|
|
49
49
|
- lib/polars/list_expr.rb
|
50
50
|
- lib/polars/list_name_space.rb
|
51
51
|
- lib/polars/meta_expr.rb
|
52
|
+
- lib/polars/plot.rb
|
52
53
|
- lib/polars/rolling_group_by.rb
|
53
54
|
- lib/polars/series.rb
|
54
55
|
- lib/polars/slice.rb
|