From the course: Using Rust with Python
Unlock this course with a free trial
Join today to access over 23,200 courses taught by industry experts.
Using Polars in Python with Rust - Rust Tutorial
From the course: Using Rust with Python
Using Polars in Python with Rust
- [Instructor] Here's an example of how the Rust DataFrame library Polars could be used in a realistic project. First up, we have the Rust project ecosystem, which includes the Cargo package management system, which would install Polars and any other libraries, for example, Clap or Criterion if you needed to do benchmarking. Once you've got all this set up, the next step would be to add some integration tests, add some unit tests, add your benchmarks, put it all together so that you're able to verify the performance, the business logic, as well as the contract for, let's say, the binary tool that you're delivering. So that's kind of the high level overview, but let's go ahead and look at Polars real quick and see at some of the things that you could do. So first up, in terms of the API here, you can see it's very straightforward. In a function, you would build out, let's say, you know, importing a CSV file, processing it, doing some groupby operations, and in terms of the performance,…
Contents
-
-
Introduction: Instructor45s
-
Introduction: Rust and Python5m
-
PyO3 installation4m 15s
-
(Locked)
Basic Rust library4m 46s
-
(Locked)
Rust to Python3m 33s
-
(Locked)
Rust ownership model4m 59s
-
(Locked)
Diagram of a PyO3 project3m 40s
-
(Locked)
Python calculator CLI3m 54s
-
(Locked)
PyO3 features2m 38s
-
(Locked)
PyO3 exceptions4m 21s
-
(Locked)
Call Python from Rust5m 53s
-
(Locked)
Run Python with embedded Rust4m 47s
-
(Locked)
Embedded Rust CLI diagram3m 34s
-
(Locked)
Embedded Rust CLI4m 31s
-
(Locked)
Embedded Rust CLI test4m 59s
-
(Locked)
Rust-built Python tools3m 52s
-
(Locked)
Using the Rust Ruff linter5m 15s
-
(Locked)
Using Polars in Python with Rust4m 9s
-
(Locked)
Polars CLI in Rust4m
-
(Locked)
Polars CLI test in Rust4m 21s
-
(Locked)
Polars CLI integration test3m 29s
-
(Locked)
Polars criterion benchmarking5m 39s
-