polars-df 0.2.5-arm64-darwin → 0.3.1-arm64-darwin
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 +1107 -699
- data/README.md +40 -2
- data/lib/polars/3.0/polars.bundle +0 -0
- data/lib/polars/3.1/polars.bundle +0 -0
- data/lib/polars/3.2/polars.bundle +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/README.md
CHANGED
@@ -282,10 +282,10 @@ df.to_dummies
|
|
282
282
|
|
283
283
|
## Conversion
|
284
284
|
|
285
|
-
Array of
|
285
|
+
Array of hashes
|
286
286
|
|
287
287
|
```ruby
|
288
|
-
df.rows
|
288
|
+
df.rows(named: true)
|
289
289
|
```
|
290
290
|
|
291
291
|
Hash of series
|
@@ -308,6 +308,12 @@ Parquet
|
|
308
308
|
df.write_parquet("file.parquet")
|
309
309
|
```
|
310
310
|
|
311
|
+
Numo array
|
312
|
+
|
313
|
+
```ruby
|
314
|
+
df.to_numo
|
315
|
+
```
|
316
|
+
|
311
317
|
## Types
|
312
318
|
|
313
319
|
You can specify column types when creating a data frame
|
@@ -343,6 +349,38 @@ Cast a column
|
|
343
349
|
df["a"].cast(Polars::Int32)
|
344
350
|
```
|
345
351
|
|
352
|
+
## Visualization
|
353
|
+
|
354
|
+
Add [Vega](https://github.com/ankane/vega-ruby) to your application’s Gemfile:
|
355
|
+
|
356
|
+
```ruby
|
357
|
+
gem "vega"
|
358
|
+
```
|
359
|
+
|
360
|
+
And use:
|
361
|
+
|
362
|
+
```ruby
|
363
|
+
df.plot("a", "b")
|
364
|
+
```
|
365
|
+
|
366
|
+
Specify the chart type (`line`, `pie`, `column`, `bar`, `area`, or `scatter`)
|
367
|
+
|
368
|
+
```ruby
|
369
|
+
df.plot("a", "b", type: "pie")
|
370
|
+
```
|
371
|
+
|
372
|
+
Group data
|
373
|
+
|
374
|
+
```ruby
|
375
|
+
df.groupby("c").plot("a", "b")
|
376
|
+
```
|
377
|
+
|
378
|
+
Stacked columns or bars
|
379
|
+
|
380
|
+
```ruby
|
381
|
+
df.groupby("c").plot("a", "b", stacked: true)
|
382
|
+
```
|
383
|
+
|
346
384
|
## History
|
347
385
|
|
348
386
|
View the [changelog](CHANGELOG.md)
|
Binary file
|
Binary file
|
Binary file
|
data/lib/polars/cat_expr.rb
CHANGED
@@ -36,13 +36,9 @@ module Polars
|
|
36
36
|
# # │ cat ┆ i64 │
|
37
37
|
# # ╞══════╪══════╡
|
38
38
|
# # │ a ┆ 2 │
|
39
|
-
# # ├╌╌╌╌╌╌┼╌╌╌╌╌╌┤
|
40
39
|
# # │ b ┆ 3 │
|
41
|
-
# # ├╌╌╌╌╌╌┼╌╌╌╌╌╌┤
|
42
40
|
# # │ k ┆ 2 │
|
43
|
-
# # ├╌╌╌╌╌╌┼╌╌╌╌╌╌┤
|
44
41
|
# # │ z ┆ 1 │
|
45
|
-
# # ├╌╌╌╌╌╌┼╌╌╌╌╌╌┤
|
46
42
|
# # │ z ┆ 3 │
|
47
43
|
# # └──────┴──────┘
|
48
44
|
def set_ordering(ordering)
|
@@ -38,13 +38,9 @@ module Polars
|
|
38
38
|
# # │ cat ┆ i64 │
|
39
39
|
# # ╞══════╪══════╡
|
40
40
|
# # │ a ┆ 2 │
|
41
|
-
# # ├╌╌╌╌╌╌┼╌╌╌╌╌╌┤
|
42
41
|
# # │ b ┆ 3 │
|
43
|
-
# # ├╌╌╌╌╌╌┼╌╌╌╌╌╌┤
|
44
42
|
# # │ k ┆ 2 │
|
45
|
-
# # ├╌╌╌╌╌╌┼╌╌╌╌╌╌┤
|
46
43
|
# # │ z ┆ 1 │
|
47
|
-
# # ├╌╌╌╌╌╌┼╌╌╌╌╌╌┤
|
48
44
|
# # │ z ┆ 3 │
|
49
45
|
# # └──────┴──────┘
|
50
46
|
def set_ordering(ordering)
|
data/lib/polars/convert.rb
CHANGED
@@ -24,7 +24,6 @@ module Polars
|
|
24
24
|
# # │ i64 ┆ i64 │
|
25
25
|
# # ╞═════╪═════╡
|
26
26
|
# # │ 1 ┆ 3 │
|
27
|
-
# # ├╌╌╌╌╌┼╌╌╌╌╌┤
|
28
27
|
# # │ 2 ┆ 4 │
|
29
28
|
# # └─────┴─────┘
|
30
29
|
def from_hash(data, columns: nil)
|
@@ -54,9 +53,7 @@ module Polars
|
|
54
53
|
# # │ i64 ┆ i64 │
|
55
54
|
# # ╞═════╪═════╡
|
56
55
|
# # │ 1 ┆ 4 │
|
57
|
-
# # ├╌╌╌╌╌┼╌╌╌╌╌┤
|
58
56
|
# # │ 2 ┆ 5 │
|
59
|
-
# # ├╌╌╌╌╌┼╌╌╌╌╌┤
|
60
57
|
# # │ 3 ┆ 6 │
|
61
58
|
# # └─────┴─────┘
|
62
59
|
#
|
@@ -70,9 +67,7 @@ module Polars
|
|
70
67
|
# # │ i32 ┆ i64 │
|
71
68
|
# # ╞═════╪═════╡
|
72
69
|
# # │ 1 ┆ 4 │
|
73
|
-
# # ├╌╌╌╌╌┼╌╌╌╌╌┤
|
74
70
|
# # │ 2 ┆ 5 │
|
75
|
-
# # ├╌╌╌╌╌┼╌╌╌╌╌┤
|
76
71
|
# # │ 3 ┆ 6 │
|
77
72
|
# # └─────┴─────┘
|
78
73
|
#
|
@@ -85,9 +80,7 @@ module Polars
|
|
85
80
|
# # │ i64 ┆ i64 ┆ i32 │
|
86
81
|
# # ╞═════╪═════╪══════╡
|
87
82
|
# # │ 1 ┆ 4 ┆ null │
|
88
|
-
# # ├╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌┤
|
89
83
|
# # │ 2 ┆ 5 ┆ null │
|
90
|
-
# # ├╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌┤
|
91
84
|
# # │ 3 ┆ 6 ┆ null │
|
92
85
|
# # └─────┴─────┴──────┘
|
93
86
|
# def from_hashes(hashes, infer_schema_length: 50, schema: nil)
|