polars-df 0.23.0 → 0.24.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +127 -1
- data/Cargo.lock +72 -58
- data/README.md +31 -27
- data/ext/polars/Cargo.toml +15 -6
- data/ext/polars/src/batched_csv.rs +35 -39
- data/ext/polars/src/c_api/allocator.rs +7 -0
- data/ext/polars/src/c_api/mod.rs +1 -0
- data/ext/polars/src/catalog/unity.rs +123 -101
- data/ext/polars/src/conversion/any_value.rs +13 -17
- data/ext/polars/src/conversion/chunked_array.rs +5 -5
- data/ext/polars/src/conversion/datetime.rs +3 -2
- data/ext/polars/src/conversion/mod.rs +50 -45
- data/ext/polars/src/dataframe/export.rs +13 -13
- data/ext/polars/src/dataframe/general.rs +223 -223
- data/ext/polars/src/dataframe/io.rs +27 -141
- data/ext/polars/src/dataframe/mod.rs +13 -5
- data/ext/polars/src/dataframe/serde.rs +1 -1
- data/ext/polars/src/error.rs +44 -7
- data/ext/polars/src/exceptions.rs +45 -12
- data/ext/polars/src/expr/array.rs +12 -0
- data/ext/polars/src/expr/datatype.rs +2 -2
- data/ext/polars/src/expr/datetime.rs +4 -5
- data/ext/polars/src/expr/general.rs +49 -13
- data/ext/polars/src/expr/list.rs +4 -0
- data/ext/polars/src/expr/meta.rs +8 -3
- data/ext/polars/src/expr/mod.rs +22 -6
- data/ext/polars/src/expr/name.rs +19 -8
- data/ext/polars/src/expr/rolling.rs +50 -1
- data/ext/polars/src/expr/string.rs +0 -1
- data/ext/polars/src/expr/struct.rs +7 -2
- data/ext/polars/src/file.rs +136 -103
- data/ext/polars/src/functions/aggregation.rs +9 -8
- data/ext/polars/src/functions/io.rs +81 -10
- data/ext/polars/src/functions/lazy.rs +95 -21
- data/ext/polars/src/functions/mod.rs +2 -0
- data/ext/polars/src/functions/range.rs +19 -3
- data/ext/polars/src/functions/strings.rs +6 -0
- data/ext/polars/src/functions/utils.rs +6 -0
- data/ext/polars/src/interop/arrow/mod.rs +50 -1
- data/ext/polars/src/interop/arrow/{to_ruby.rs → to_rb.rs} +30 -0
- data/ext/polars/src/interop/arrow/to_rust.rs +43 -0
- data/ext/polars/src/interop/numo/to_numo_df.rs +1 -1
- data/ext/polars/src/interop/numo/to_numo_series.rs +1 -1
- data/ext/polars/src/lazyframe/exitable.rs +39 -0
- data/ext/polars/src/lazyframe/general.rs +340 -236
- data/ext/polars/src/lazyframe/mod.rs +46 -10
- data/ext/polars/src/lazyframe/optflags.rs +5 -4
- data/ext/polars/src/lazyframe/serde.rs +11 -3
- data/ext/polars/src/lazyframe/sink.rs +10 -5
- data/ext/polars/src/lazygroupby.rs +6 -7
- data/ext/polars/src/lib.rs +141 -76
- data/ext/polars/src/map/dataframe.rs +12 -12
- data/ext/polars/src/map/lazy.rs +7 -5
- data/ext/polars/src/map/mod.rs +15 -8
- data/ext/polars/src/map/series.rs +3 -3
- data/ext/polars/src/on_startup.rs +16 -8
- data/ext/polars/src/prelude.rs +1 -0
- data/ext/polars/src/rb_modules.rs +19 -49
- data/ext/polars/src/series/aggregation.rs +79 -140
- data/ext/polars/src/series/arithmetic.rs +16 -22
- data/ext/polars/src/series/comparison.rs +101 -222
- data/ext/polars/src/series/construction.rs +17 -18
- data/ext/polars/src/series/export.rs +1 -1
- data/ext/polars/src/series/general.rs +254 -289
- data/ext/polars/src/series/import.rs +17 -0
- data/ext/polars/src/series/map.rs +178 -160
- data/ext/polars/src/series/mod.rs +28 -12
- data/ext/polars/src/series/scatter.rs +12 -9
- data/ext/polars/src/sql.rs +16 -9
- data/ext/polars/src/testing/frame.rs +31 -0
- data/ext/polars/src/testing/mod.rs +5 -0
- data/ext/polars/src/testing/series.rs +31 -0
- data/ext/polars/src/timeout.rs +105 -0
- data/ext/polars/src/utils.rs +159 -1
- data/lib/polars/array_expr.rb +81 -12
- data/lib/polars/array_name_space.rb +74 -7
- data/lib/polars/batched_csv_reader.rb +21 -21
- data/lib/polars/binary_name_space.rb +1 -1
- data/lib/polars/cat_expr.rb +7 -7
- data/lib/polars/config.rb +1 -1
- data/lib/polars/convert.rb +189 -34
- data/lib/polars/data_frame.rb +1066 -831
- data/lib/polars/data_frame_plot.rb +173 -0
- data/lib/polars/data_type_group.rb +1 -0
- data/lib/polars/data_types.rb +31 -12
- data/lib/polars/date_time_expr.rb +51 -69
- data/lib/polars/date_time_name_space.rb +80 -112
- data/lib/polars/dynamic_group_by.rb +7 -7
- data/lib/polars/exceptions.rb +50 -10
- data/lib/polars/expr.rb +470 -517
- data/lib/polars/functions/aggregation/horizontal.rb +0 -1
- data/lib/polars/functions/aggregation/vertical.rb +2 -3
- data/lib/polars/functions/as_datatype.rb +290 -8
- data/lib/polars/functions/eager.rb +204 -10
- data/lib/polars/functions/escape_regex.rb +21 -0
- data/lib/polars/functions/lazy.rb +409 -169
- data/lib/polars/functions/lit.rb +17 -1
- data/lib/polars/functions/range/int_range.rb +74 -2
- data/lib/polars/functions/range/linear_space.rb +77 -0
- data/lib/polars/functions/range/time_range.rb +1 -1
- data/lib/polars/functions/repeat.rb +3 -12
- data/lib/polars/functions/whenthen.rb +2 -2
- data/lib/polars/group_by.rb +72 -20
- data/lib/polars/iceberg_dataset.rb +1 -6
- data/lib/polars/in_process_query.rb +37 -0
- data/lib/polars/io/cloud.rb +18 -0
- data/lib/polars/io/csv.rb +265 -126
- data/lib/polars/io/database.rb +0 -1
- data/lib/polars/io/delta.rb +15 -7
- data/lib/polars/io/ipc.rb +24 -17
- data/lib/polars/io/ndjson.rb +161 -24
- data/lib/polars/io/parquet.rb +101 -38
- data/lib/polars/lazy_frame.rb +849 -558
- data/lib/polars/lazy_group_by.rb +327 -2
- data/lib/polars/list_expr.rb +94 -16
- data/lib/polars/list_name_space.rb +88 -24
- data/lib/polars/meta_expr.rb +42 -1
- data/lib/polars/name_expr.rb +41 -4
- data/lib/polars/query_opt_flags.rb +198 -2
- data/lib/polars/rolling_group_by.rb +3 -3
- data/lib/polars/schema.rb +21 -3
- data/lib/polars/selector.rb +37 -2
- data/lib/polars/selectors.rb +45 -9
- data/lib/polars/series.rb +1156 -728
- data/lib/polars/series_plot.rb +72 -0
- data/lib/polars/slice.rb +1 -1
- data/lib/polars/sql_context.rb +11 -4
- data/lib/polars/string_expr.rb +59 -68
- data/lib/polars/string_name_space.rb +51 -87
- data/lib/polars/struct_expr.rb +36 -18
- data/lib/polars/testing.rb +24 -273
- data/lib/polars/utils/constants.rb +2 -0
- data/lib/polars/utils/construction/data_frame.rb +410 -0
- data/lib/polars/utils/construction/series.rb +364 -0
- data/lib/polars/utils/construction/utils.rb +9 -0
- data/lib/polars/utils/deprecation.rb +11 -0
- data/lib/polars/utils/serde.rb +8 -3
- data/lib/polars/utils/unstable.rb +19 -0
- data/lib/polars/utils/various.rb +59 -0
- data/lib/polars/utils.rb +46 -47
- data/lib/polars/version.rb +1 -1
- data/lib/polars.rb +47 -1
- metadata +25 -6
- data/ext/polars/src/allocator.rs +0 -13
- data/lib/polars/plot.rb +0 -109
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ba1e4a6372c0782979745537b3e590503c0861bd13440578c519692469a43aaa
|
|
4
|
+
data.tar.gz: 62667e600bc2b0231d72a1026416e5efcfd3cb9cbb21d1ef113c3074be0121f4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d09b6ae1a26ccf3781c46c02d73712fb83fdf72f0742b488175282bb52bd0a1542f36b44576b77653f45797b3a25ae78b26e3e6845bab8bc08c80d9c7f2c641b
|
|
7
|
+
data.tar.gz: 04d8e47b2551e6614b0aa0563a6757a7d5a192c4726d013e5baa08aa534647c29d07bf980d11614f0f4f9e6a311a9a8c79833ef5595a2b97817a7e189300aa04
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,129 @@
|
|
|
1
|
+
## 0.24.0 (2026-02-04)
|
|
2
|
+
|
|
3
|
+
- Added support for Ruby 4.0
|
|
4
|
+
- Added support for streaming engine
|
|
5
|
+
- Added support for releasing GVL
|
|
6
|
+
- Added experimental support for background queries
|
|
7
|
+
- Improved exception classes
|
|
8
|
+
- Changed `schema` method to return `Schema` instead of `Hash`
|
|
9
|
+
- Changed `partition_by(as_dict: true)` method to always return `Array` keys
|
|
10
|
+
- Removed support for string and symbol data types (`:i32`, `:f64`, etc.)
|
|
11
|
+
- Dropped support for Ruby < 3.3
|
|
12
|
+
|
|
13
|
+
Changed defaults
|
|
14
|
+
|
|
15
|
+
- Changed default `statistics` for `write_parquet` method from `false` to `true`
|
|
16
|
+
- Changed default `compression` for `sink_ipc` method from `zstd` to `uncompressed`
|
|
17
|
+
- Changed default `raise_if_empty` for `read_csv` method from `false` to `true`
|
|
18
|
+
- Changed default `eager` for `ones` and `zeros` method from `true` to `false`
|
|
19
|
+
- Changed default `ignore_nulls` for `ewm_mean`, `ewm_std`, and `ewm_var` methods from `true` to `false`
|
|
20
|
+
- Changed default `null_on_oob` for `get` method from `true` to `false`
|
|
21
|
+
- Changed default `maintain_order` for `unique` method from `true` to `false` for `DataFrame` and `LazyFrame`
|
|
22
|
+
- Changed default `keep` for `unique` method from `first` to `any` for `DataFrame` and `LazyFrame`
|
|
23
|
+
- Changed default `null_equal` for `equals` method from `false` to `true` for `Series`
|
|
24
|
+
- Changed default `strict` for `decode` method from `false` to `true` for `StringNameSpace`
|
|
25
|
+
|
|
26
|
+
Added methods
|
|
27
|
+
|
|
28
|
+
- Added `plot` method to `Series`
|
|
29
|
+
- Added `concat_arr`, `escape_regex`, `int_ranges`, and `linear_spaces` methods to `Polars`
|
|
30
|
+
- Added `rolling_rank` and `rolling_rank_by` methods to `Series` and `Expr`
|
|
31
|
+
- Added `days_in_month` method to `DateTimeExpr` and `DateTimeNameSpace`
|
|
32
|
+
- Added `agg` and `item` methods to `ListExpr` and `ListNameSpace`
|
|
33
|
+
- Added `agg` and `eval` methods to `ArrayExpr` and `ArrayNameSpace`
|
|
34
|
+
- Added `replace` method to `NameExpr`
|
|
35
|
+
|
|
36
|
+
Added options
|
|
37
|
+
|
|
38
|
+
- Added more options to `read_csv` and `scan_csv` methods
|
|
39
|
+
- Added more options to `read_ndjson` and `scan_ndjson` methods
|
|
40
|
+
- Added more options to `write_csv` method
|
|
41
|
+
- Added more options to `sort` method
|
|
42
|
+
- Added more options to `over` method
|
|
43
|
+
- Added `ambiguous` option to `strptime` method
|
|
44
|
+
|
|
45
|
+
Renamed options
|
|
46
|
+
|
|
47
|
+
- Renamed `reverse` option to `descending`
|
|
48
|
+
- Renamed `sep` option to `separator`
|
|
49
|
+
- Renamed `row_count_name` option to `row_index_name`
|
|
50
|
+
- Renamed `row_count_offset` option to `row_index_offset`
|
|
51
|
+
- Renamed `comment_char` option to `comment_prefix` for `read_csv`, `read_csv_batched`, and `scan_csv` methods
|
|
52
|
+
- Renamed `dtypes` option to `schema_overrides` for `read_csv`, `read_csv_batched`, and `scan_csv` methods
|
|
53
|
+
- Renamed `parse_dates` option to `try_parse_dates` for `read_csv`, `read_csv_batched`, and `scan_csv` methods
|
|
54
|
+
- Renamed `min_periods` option to `min_samples`
|
|
55
|
+
- Renamed `by` option to `group_by` for `group_by_dynamic`, `rolling`, and `upsample` methods
|
|
56
|
+
- Renamed `frac` option to `fraction` for `sample` methods
|
|
57
|
+
- Renamed `drop_nulls` option to `ignore_nulls` for `all` and `any` methods
|
|
58
|
+
- Renamed `join_nulls` option to `nulls_equal` for `join` method
|
|
59
|
+
- Renamed `strict` option to `check_dtypes` for `equals` method
|
|
60
|
+
- Renamed `quote` option to `quote_char` for `write_csv` method
|
|
61
|
+
- Renamed `data_pagesize_limit` option to `data_page_size` for `sink_parquet` method
|
|
62
|
+
- Renamed `unit` option to `time_unit` for `from_epoch` method
|
|
63
|
+
- Renamed `eager_execution` option to `eager` for `SQLContext` constructor
|
|
64
|
+
|
|
65
|
+
Removed methods
|
|
66
|
+
|
|
67
|
+
- Removed `take` and `take_every` methods (use `gather` and `gather_every` instead)
|
|
68
|
+
- Removed `clip_min` and `clip_max` methods (use `clip` instead)
|
|
69
|
+
- Removed `argsort` and `argsort_by` methods (use `arg_sort` and `arg_sort_by` instead)
|
|
70
|
+
- Removed `shift_and_fill` methods (use `shift(fill_value:)` instead)
|
|
71
|
+
- Removed `group`, `groupby`, `groupby_dynamic`, and `groupby_rolling` methods (use `group_by*` instead)
|
|
72
|
+
- Removed `group_by_rolling` methods (use `rolling` instead)
|
|
73
|
+
- Removed `asin`, `asinh`, `acos`, `acosh`, `atan`, and `atanh` methods (use `arc*` instead)
|
|
74
|
+
- Removed `days`, `hours`, `minutes`, `seconds`, `milliseconds`, `microseconds`, and `nanoseconds` methods (use `total_*` instead)
|
|
75
|
+
- Removed `cumsum`, `cumsum_horizontal`, `cumprod`, `cummin`, `cummax`, `cumcount`, and `cumfold` methods (use `cum_*` instead)
|
|
76
|
+
- Removed `with_column` methods (use `with_columns` instead)
|
|
77
|
+
- Removed `where` method (use `filter` instead)
|
|
78
|
+
- Removed `series_equal` and `frame_equal` methods (use `equals` instead)
|
|
79
|
+
- Removed `apply` methods (use `map_elements` or `map_rows` instead)
|
|
80
|
+
- Removed `lengths` methods (use `len` or `len_bytes` instead)
|
|
81
|
+
- Removed `keep_name`, `prefix`, `suffix`, and `map_alias` methods (use `name` methods instead)
|
|
82
|
+
- Removed `ljust` and `rjust` methods (use `pad_end` and `pad_start` instead)
|
|
83
|
+
- Removed `lstrip` and `rstrip` methods (use `strip_chars_start` and `strip_chars_end` instead)
|
|
84
|
+
- Removed `strip` method (use `strip_chars` instead)
|
|
85
|
+
- Removed `n_chars` method (use `len_chars` instead)
|
|
86
|
+
- Removed `parse_int` method (use `to_integer` instead)
|
|
87
|
+
- Removed `json_extract` method (use `json_decode` instead)
|
|
88
|
+
- Removed `cleared` methods (use `clear` instead)
|
|
89
|
+
- Removed `melt` method (use `unpivot` instead)
|
|
90
|
+
- Removed `count_match` methods (use `count_matches` instead)
|
|
91
|
+
- Removed `is_numeric`, `is_datelike`, `is_temporal`, `is_float`, `is_bool`, `is_boolean`, and `is_utf8` methods from `Series` (use `dtype` methods instead)
|
|
92
|
+
- Removed `numeric?`, `datelike?`, `temporal?`, `float?`, `bool?`, `boolean?`, and `utf8?` methods from `Series` (use `dtype` methods instead)
|
|
93
|
+
- Removed `is_first` method (use `is_first_distinct` instead)
|
|
94
|
+
- Removed `approx_unique` method (use `approx_n_unique` instead)
|
|
95
|
+
- Removed `set_at_idx` method (use `scatter` instead)
|
|
96
|
+
- Removed `insert_at_idx` and `replace_at_idx` methods (use `insert_column` and `replace_column` instead)
|
|
97
|
+
- Removed `find_idx_by_name` method (use `get_column_index` instead)
|
|
98
|
+
- Removed `avg` method (use `mean` instead)
|
|
99
|
+
- Removed `arctan2d` method (use `arctan2` + `degrees` instead)
|
|
100
|
+
- Removed `read_sql` method (use `read_database` instead)
|
|
101
|
+
- Removed `with_row_count` methods (use `with_row_index` instead)
|
|
102
|
+
- Removed `has_validity` method (use `has_nulls` instead)
|
|
103
|
+
- Removed `shrink_dtype` method from `Expr` (use `Series#shrink_dtype` instead)
|
|
104
|
+
- Removed `replace` method from `DataFrame` (use `[]=` instead)
|
|
105
|
+
- Removed `read_json` and `write_json` methods from `LazyFrame` (use `deserialize` and `serialize` instead)
|
|
106
|
+
- Removed `fetch` method from `LazyFrame` (use `head` + `collect` instead)
|
|
107
|
+
- Removed `with_context` method from `LazyFrame` (use `Polars.concat(how: "horizontal")` instead)
|
|
108
|
+
- Removed `with_time_unit` method from `DateTimeExpr` and `DateTimeNameSpace` (use `cast(Polars::Int64).cast(Polars::Datetime.new(...))` instead)
|
|
109
|
+
- Removed `datetime` method from `DateTimeExpr` (use `replace_time_zone` instead)
|
|
110
|
+
- Removed `mean` and `median` methods from `DateTimeNameSpace` (use `Series#mean` and `Series#median` instead)
|
|
111
|
+
- Removed `concat` method from `StringExpr` and `StringNameSpace` (use `join("-")` instead)
|
|
112
|
+
- Removed `describe_plan` and `describe_optimized_plan` methods (use `explain` instead)
|
|
113
|
+
- Removed `plot` method from `GroupBy` (use `DataFrame#plot` instead)
|
|
114
|
+
|
|
115
|
+
Removed options
|
|
116
|
+
|
|
117
|
+
- Removed `dtype_if_empty` option from `Series` constructor
|
|
118
|
+
- Removed `warn_if_unsorted` option from `rolling_*_by` methods
|
|
119
|
+
- Removed `in_place` option from `rename` method
|
|
120
|
+
- Removed `append_chunks` option from `append` method
|
|
121
|
+
- Removed `name` option from `repeat` method
|
|
122
|
+
- Removed `utc` option from `strptime` method
|
|
123
|
+
- Removed `truncate` option from `group_by_dynamic` methods
|
|
124
|
+
- Removed `eager` option from `from_epoch` method
|
|
125
|
+
- Removed `string_cache` option from `collect` and `collect_all` methods
|
|
126
|
+
|
|
1
127
|
## 0.23.0 (2025-11-04)
|
|
2
128
|
|
|
3
129
|
- Updated Polars to 0.52.0
|
|
@@ -21,7 +147,7 @@
|
|
|
21
147
|
- Added more methods to `ArrayExpr` and `ArrayNameSpace`
|
|
22
148
|
- Added more methods to `BinaryExpr` and `BinaryNameSpace`
|
|
23
149
|
- Added more methods to `CatExpr` and `CatNameSpace`
|
|
24
|
-
- Added more methods to `DateTimeExpr`
|
|
150
|
+
- Added more methods to `DateTimeExpr` and `DateTimeNameSpace`
|
|
25
151
|
- Added more methods to `ListExpr` and `ListNameSpace`
|
|
26
152
|
- Added more methods to `MetaExpr`
|
|
27
153
|
- Added more methods to `NameExpr`
|
data/Cargo.lock
CHANGED
|
@@ -338,9 +338,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
|
|
|
338
338
|
|
|
339
339
|
[[package]]
|
|
340
340
|
name = "bytes"
|
|
341
|
-
version = "1.
|
|
341
|
+
version = "1.11.1"
|
|
342
342
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
343
|
-
checksum = "
|
|
343
|
+
checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33"
|
|
344
344
|
dependencies = [
|
|
345
345
|
"serde",
|
|
346
346
|
]
|
|
@@ -1224,26 +1224,6 @@ version = "1.0.15"
|
|
|
1224
1224
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1225
1225
|
checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c"
|
|
1226
1226
|
|
|
1227
|
-
[[package]]
|
|
1228
|
-
name = "jemalloc-sys"
|
|
1229
|
-
version = "0.5.4+5.3.0-patched"
|
|
1230
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1231
|
-
checksum = "ac6c1946e1cea1788cbfde01c993b52a10e2da07f4bac608228d1bed20bfebf2"
|
|
1232
|
-
dependencies = [
|
|
1233
|
-
"cc",
|
|
1234
|
-
"libc",
|
|
1235
|
-
]
|
|
1236
|
-
|
|
1237
|
-
[[package]]
|
|
1238
|
-
name = "jemallocator"
|
|
1239
|
-
version = "0.5.4"
|
|
1240
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1241
|
-
checksum = "a0de374a9f8e63150e6f5e8a60cc14c668226d7a347d8aee1a45766e3c4dd3bc"
|
|
1242
|
-
dependencies = [
|
|
1243
|
-
"jemalloc-sys",
|
|
1244
|
-
"libc",
|
|
1245
|
-
]
|
|
1246
|
-
|
|
1247
1227
|
[[package]]
|
|
1248
1228
|
name = "jobserver"
|
|
1249
1229
|
version = "0.1.33"
|
|
@@ -1331,9 +1311,9 @@ checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de"
|
|
|
1331
1311
|
|
|
1332
1312
|
[[package]]
|
|
1333
1313
|
name = "libmimalloc-sys"
|
|
1334
|
-
version = "0.1.
|
|
1314
|
+
version = "0.1.44"
|
|
1335
1315
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1336
|
-
checksum = "
|
|
1316
|
+
checksum = "667f4fec20f29dfc6bc7357c582d91796c169ad7e2fce709468aefeb2c099870"
|
|
1337
1317
|
dependencies = [
|
|
1338
1318
|
"cc",
|
|
1339
1319
|
"libc",
|
|
@@ -1458,9 +1438,9 @@ dependencies = [
|
|
|
1458
1438
|
|
|
1459
1439
|
[[package]]
|
|
1460
1440
|
name = "mimalloc"
|
|
1461
|
-
version = "0.1.
|
|
1441
|
+
version = "0.1.48"
|
|
1462
1442
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1463
|
-
checksum = "
|
|
1443
|
+
checksum = "e1ee66a4b64c74f4ef288bcbb9192ad9c3feaad75193129ac8509af543894fd8"
|
|
1464
1444
|
dependencies = [
|
|
1465
1445
|
"libmimalloc-sys",
|
|
1466
1446
|
]
|
|
@@ -1672,34 +1652,6 @@ dependencies = [
|
|
|
1672
1652
|
"hashbrown 0.15.3",
|
|
1673
1653
|
]
|
|
1674
1654
|
|
|
1675
|
-
[[package]]
|
|
1676
|
-
name = "polars"
|
|
1677
|
-
version = "0.23.0"
|
|
1678
|
-
dependencies = [
|
|
1679
|
-
"ahash",
|
|
1680
|
-
"bytes",
|
|
1681
|
-
"chrono",
|
|
1682
|
-
"either",
|
|
1683
|
-
"jemallocator",
|
|
1684
|
-
"magnus",
|
|
1685
|
-
"mimalloc",
|
|
1686
|
-
"num-traits",
|
|
1687
|
-
"polars 0.52.0",
|
|
1688
|
-
"polars-arrow",
|
|
1689
|
-
"polars-compute",
|
|
1690
|
-
"polars-core",
|
|
1691
|
-
"polars-dtype",
|
|
1692
|
-
"polars-error",
|
|
1693
|
-
"polars-io",
|
|
1694
|
-
"polars-lazy",
|
|
1695
|
-
"polars-parquet",
|
|
1696
|
-
"polars-plan",
|
|
1697
|
-
"polars-utils",
|
|
1698
|
-
"rayon",
|
|
1699
|
-
"regex",
|
|
1700
|
-
"serde_json",
|
|
1701
|
-
]
|
|
1702
|
-
|
|
1703
1655
|
[[package]]
|
|
1704
1656
|
name = "polars"
|
|
1705
1657
|
version = "0.52.0"
|
|
@@ -2135,6 +2087,38 @@ dependencies = [
|
|
|
2135
2087
|
"polars-utils",
|
|
2136
2088
|
]
|
|
2137
2089
|
|
|
2090
|
+
[[package]]
|
|
2091
|
+
name = "polars-ruby"
|
|
2092
|
+
version = "0.24.0"
|
|
2093
|
+
dependencies = [
|
|
2094
|
+
"ahash",
|
|
2095
|
+
"bytes",
|
|
2096
|
+
"chrono",
|
|
2097
|
+
"either",
|
|
2098
|
+
"magnus",
|
|
2099
|
+
"mimalloc",
|
|
2100
|
+
"num-traits",
|
|
2101
|
+
"parking_lot",
|
|
2102
|
+
"polars",
|
|
2103
|
+
"polars-arrow",
|
|
2104
|
+
"polars-compute",
|
|
2105
|
+
"polars-core",
|
|
2106
|
+
"polars-dtype",
|
|
2107
|
+
"polars-error",
|
|
2108
|
+
"polars-io",
|
|
2109
|
+
"polars-lazy",
|
|
2110
|
+
"polars-ops",
|
|
2111
|
+
"polars-parquet",
|
|
2112
|
+
"polars-plan",
|
|
2113
|
+
"polars-testing",
|
|
2114
|
+
"polars-utils",
|
|
2115
|
+
"rayon",
|
|
2116
|
+
"rb-sys",
|
|
2117
|
+
"regex",
|
|
2118
|
+
"serde_json",
|
|
2119
|
+
"tikv-jemallocator",
|
|
2120
|
+
]
|
|
2121
|
+
|
|
2138
2122
|
[[package]]
|
|
2139
2123
|
name = "polars-schema"
|
|
2140
2124
|
version = "0.52.0"
|
|
@@ -2209,6 +2193,16 @@ dependencies = [
|
|
|
2209
2193
|
"version_check",
|
|
2210
2194
|
]
|
|
2211
2195
|
|
|
2196
|
+
[[package]]
|
|
2197
|
+
name = "polars-testing"
|
|
2198
|
+
version = "0.52.0"
|
|
2199
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2200
|
+
checksum = "9626bad4c4c1b7382601be00ce87c65809dc843fa40b35721eaf92397ca8b6ce"
|
|
2201
|
+
dependencies = [
|
|
2202
|
+
"polars-core",
|
|
2203
|
+
"polars-ops",
|
|
2204
|
+
]
|
|
2205
|
+
|
|
2212
2206
|
[[package]]
|
|
2213
2207
|
name = "polars-time"
|
|
2214
2208
|
version = "0.52.0"
|
|
@@ -2452,18 +2446,18 @@ dependencies = [
|
|
|
2452
2446
|
|
|
2453
2447
|
[[package]]
|
|
2454
2448
|
name = "rb-sys"
|
|
2455
|
-
version = "0.9.
|
|
2449
|
+
version = "0.9.124"
|
|
2456
2450
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2457
|
-
checksum = "
|
|
2451
|
+
checksum = "c85c4188462601e2aa1469def389c17228566f82ea72f137ed096f21591bc489"
|
|
2458
2452
|
dependencies = [
|
|
2459
2453
|
"rb-sys-build",
|
|
2460
2454
|
]
|
|
2461
2455
|
|
|
2462
2456
|
[[package]]
|
|
2463
2457
|
name = "rb-sys-build"
|
|
2464
|
-
version = "0.9.
|
|
2458
|
+
version = "0.9.124"
|
|
2465
2459
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2466
|
-
checksum = "
|
|
2460
|
+
checksum = "568068db4102230882e6d4ae8de6632e224ca75fe5970f6e026a04e91ed635d3"
|
|
2467
2461
|
dependencies = [
|
|
2468
2462
|
"bindgen",
|
|
2469
2463
|
"lazy_static",
|
|
@@ -3117,6 +3111,26 @@ dependencies = [
|
|
|
3117
3111
|
"syn",
|
|
3118
3112
|
]
|
|
3119
3113
|
|
|
3114
|
+
[[package]]
|
|
3115
|
+
name = "tikv-jemalloc-sys"
|
|
3116
|
+
version = "0.6.1+5.3.0-1-ge13ca993e8ccb9ba9847cc330696e02839f328f7"
|
|
3117
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3118
|
+
checksum = "cd8aa5b2ab86a2cefa406d889139c162cbb230092f7d1d7cbc1716405d852a3b"
|
|
3119
|
+
dependencies = [
|
|
3120
|
+
"cc",
|
|
3121
|
+
"libc",
|
|
3122
|
+
]
|
|
3123
|
+
|
|
3124
|
+
[[package]]
|
|
3125
|
+
name = "tikv-jemallocator"
|
|
3126
|
+
version = "0.6.1"
|
|
3127
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3128
|
+
checksum = "0359b4327f954e0567e69fb191cf1436617748813819c94b8cd4a431422d053a"
|
|
3129
|
+
dependencies = [
|
|
3130
|
+
"libc",
|
|
3131
|
+
"tikv-jemalloc-sys",
|
|
3132
|
+
]
|
|
3133
|
+
|
|
3120
3134
|
[[package]]
|
|
3121
3135
|
name = "tinystr"
|
|
3122
3136
|
version = "0.8.1"
|
data/README.md
CHANGED
|
@@ -88,13 +88,13 @@ From Avro
|
|
|
88
88
|
Polars.read_avro("file.avro")
|
|
89
89
|
```
|
|
90
90
|
|
|
91
|
-
From Iceberg (requires [iceberg](https://github.com/ankane/iceberg-ruby))
|
|
91
|
+
From Iceberg (experimental, requires [iceberg](https://github.com/ankane/iceberg-ruby))
|
|
92
92
|
|
|
93
93
|
```ruby
|
|
94
94
|
Polars.scan_iceberg(table)
|
|
95
95
|
```
|
|
96
96
|
|
|
97
|
-
From Delta Lake (requires [deltalake-rb](https://github.com/ankane/delta-ruby))
|
|
97
|
+
From Delta Lake (experimental, requires [deltalake-rb](https://github.com/ankane/delta-ruby))
|
|
98
98
|
|
|
99
99
|
```ruby
|
|
100
100
|
Polars.read_delta("./table")
|
|
@@ -182,20 +182,20 @@ df.tail
|
|
|
182
182
|
Filter on a condition
|
|
183
183
|
|
|
184
184
|
```ruby
|
|
185
|
-
df
|
|
186
|
-
df
|
|
187
|
-
df
|
|
188
|
-
df
|
|
189
|
-
df
|
|
190
|
-
df
|
|
185
|
+
df.filter(Polars.col("a") == 2)
|
|
186
|
+
df.filter(Polars.col("a") != 2)
|
|
187
|
+
df.filter(Polars.col("a") > 2)
|
|
188
|
+
df.filter(Polars.col("a") >= 2)
|
|
189
|
+
df.filter(Polars.col("a") < 2)
|
|
190
|
+
df.filter(Polars.col("a") <= 2)
|
|
191
191
|
```
|
|
192
192
|
|
|
193
193
|
And, or, and exclusive or
|
|
194
194
|
|
|
195
195
|
```ruby
|
|
196
|
-
df
|
|
197
|
-
df
|
|
198
|
-
df
|
|
196
|
+
df.filter((Polars.col("a") > 1) & (Polars.col("b") == "two")) # and
|
|
197
|
+
df.filter((Polars.col("a") > 1) | (Polars.col("b") == "two")) # or
|
|
198
|
+
df.filter((Polars.col("a") > 1) ^ (Polars.col("b") == "two")) # xor
|
|
199
199
|
```
|
|
200
200
|
|
|
201
201
|
## Operations
|
|
@@ -240,9 +240,9 @@ Trigonometric functions
|
|
|
240
240
|
df["a"].sin
|
|
241
241
|
df["a"].cos
|
|
242
242
|
df["a"].tan
|
|
243
|
-
df["a"].
|
|
244
|
-
df["a"].
|
|
245
|
-
df["a"].
|
|
243
|
+
df["a"].arcsin
|
|
244
|
+
df["a"].arccos
|
|
245
|
+
df["a"].arctan
|
|
246
246
|
```
|
|
247
247
|
|
|
248
248
|
Hyperbolic functions
|
|
@@ -251,9 +251,9 @@ Hyperbolic functions
|
|
|
251
251
|
df["a"].sinh
|
|
252
252
|
df["a"].cosh
|
|
253
253
|
df["a"].tanh
|
|
254
|
-
df["a"].
|
|
255
|
-
df["a"].
|
|
256
|
-
df["a"].
|
|
254
|
+
df["a"].arcsinh
|
|
255
|
+
df["a"].arccosh
|
|
256
|
+
df["a"].arctanh
|
|
257
257
|
```
|
|
258
258
|
|
|
259
259
|
Summary statistics
|
|
@@ -328,7 +328,7 @@ df.to_dummies
|
|
|
328
328
|
Array of hashes
|
|
329
329
|
|
|
330
330
|
```ruby
|
|
331
|
-
df.
|
|
331
|
+
df.to_a
|
|
332
332
|
```
|
|
333
333
|
|
|
334
334
|
Hash of series
|
|
@@ -371,13 +371,13 @@ Avro
|
|
|
371
371
|
df.write_avro("file.avro")
|
|
372
372
|
```
|
|
373
373
|
|
|
374
|
-
Iceberg
|
|
374
|
+
Iceberg (experimental)
|
|
375
375
|
|
|
376
376
|
```ruby
|
|
377
377
|
df.write_iceberg(table, mode: "append")
|
|
378
378
|
```
|
|
379
379
|
|
|
380
|
-
Delta Lake
|
|
380
|
+
Delta Lake (experimental)
|
|
381
381
|
|
|
382
382
|
```ruby
|
|
383
383
|
df.write_delta("./table")
|
|
@@ -438,27 +438,31 @@ gem "vega"
|
|
|
438
438
|
And use:
|
|
439
439
|
|
|
440
440
|
```ruby
|
|
441
|
-
df.plot("a", "b")
|
|
441
|
+
df.plot.line("a", "b")
|
|
442
442
|
```
|
|
443
443
|
|
|
444
|
-
|
|
444
|
+
Supports `line`, `pie`, `column`, `bar`, `area`, and `scatter` plots
|
|
445
|
+
|
|
446
|
+
Group data
|
|
445
447
|
|
|
446
448
|
```ruby
|
|
447
|
-
df.plot("a", "b",
|
|
449
|
+
df.plot.line("a", "b", color: "c")
|
|
448
450
|
```
|
|
449
451
|
|
|
450
|
-
|
|
452
|
+
Stacked columns or bars
|
|
451
453
|
|
|
452
454
|
```ruby
|
|
453
|
-
df.
|
|
455
|
+
df.plot.column("a", "b", color: "c", stacked: true)
|
|
454
456
|
```
|
|
455
457
|
|
|
456
|
-
|
|
458
|
+
Plot a series
|
|
457
459
|
|
|
458
460
|
```ruby
|
|
459
|
-
df
|
|
461
|
+
df["a"].plot.hist
|
|
460
462
|
```
|
|
461
463
|
|
|
464
|
+
Supports `hist`, `kde`, and `line` plots
|
|
465
|
+
|
|
462
466
|
## History
|
|
463
467
|
|
|
464
468
|
View the [changelog](https://github.com/ankane/ruby-polars/blob/master/CHANGELOG.md)
|
data/ext/polars/Cargo.toml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
|
-
name = "polars"
|
|
3
|
-
version = "0.
|
|
2
|
+
name = "polars-ruby"
|
|
3
|
+
version = "0.24.0"
|
|
4
4
|
license = "MIT"
|
|
5
5
|
authors = ["Andrew Kane <andrew@ankane.org>"]
|
|
6
6
|
edition = "2024"
|
|
@@ -8,6 +8,7 @@ rust-version = "1.89.0"
|
|
|
8
8
|
publish = false
|
|
9
9
|
|
|
10
10
|
[lib]
|
|
11
|
+
name = "polars"
|
|
11
12
|
crate-type = ["cdylib"]
|
|
12
13
|
|
|
13
14
|
[dependencies]
|
|
@@ -18,16 +19,20 @@ chrono = "0.4"
|
|
|
18
19
|
either = "1.8"
|
|
19
20
|
magnus = { version = "0.8", features = ["chrono"] }
|
|
20
21
|
num-traits = "0.2"
|
|
22
|
+
parking_lot = "0.12"
|
|
21
23
|
polars-compute = "=0.52.0"
|
|
22
24
|
polars-core = "=0.52.0"
|
|
23
25
|
polars-dtype = "=0.52.0"
|
|
24
26
|
polars-error = "=0.52.0"
|
|
25
27
|
polars-io = "=0.52.0"
|
|
26
28
|
polars-lazy = { version = "=0.52.0", features = ["catalog"] }
|
|
29
|
+
polars-ops = "=0.52.0"
|
|
27
30
|
polars-plan = "=0.52.0"
|
|
28
31
|
polars-parquet = "=0.52.0"
|
|
32
|
+
polars-testing = "=0.52.0"
|
|
29
33
|
polars-utils = "=0.52.0"
|
|
30
34
|
rayon = "1.9"
|
|
35
|
+
rb-sys = "0.9"
|
|
31
36
|
regex = "1"
|
|
32
37
|
serde_json = "1"
|
|
33
38
|
|
|
@@ -59,6 +64,7 @@ features = [
|
|
|
59
64
|
"dataframe_arithmetic",
|
|
60
65
|
"diagonal_concat",
|
|
61
66
|
"diff",
|
|
67
|
+
"dot_diagram",
|
|
62
68
|
"dot_product",
|
|
63
69
|
"dtype-full",
|
|
64
70
|
"dynamic_group_by",
|
|
@@ -138,12 +144,15 @@ features = [
|
|
|
138
144
|
"unique_counts",
|
|
139
145
|
]
|
|
140
146
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
[target.'cfg(
|
|
147
|
+
# allocators differ from Python due to issues with cross-compilation
|
|
148
|
+
# Windows cross-compilation requires libmimalloc-sys <= 0.1.38, so skip for now
|
|
149
|
+
# https://github.com/purpleprotocol/mimalloc_rust/issues/125
|
|
150
|
+
[target.'cfg(target_os = "macos")'.dependencies]
|
|
145
151
|
mimalloc = { version = "0.1", default-features = false }
|
|
146
152
|
|
|
153
|
+
[target.'cfg(target_os = "linux")'.dependencies]
|
|
154
|
+
tikv-jemallocator = { version = "0.6", features = ["disable_initial_exec_tls"] }
|
|
155
|
+
|
|
147
156
|
[features]
|
|
148
157
|
default = []
|
|
149
158
|
serialize_binary = []
|