No project description provided
Project description
polars_qt
Add a qt namespace for polars.
Currently :
-
a rolling_rank function
-
A if-then expression.
rolling_rank
import polars as pl
import polars_qt as pq
df = pl.DataFrame({
'a': [5.2, 4.1, 6.3, None, 10, 4, 5],
})
df.with_columns(
pq.rolling_rank(pl.col('a'), 4, min_periods=1, pct=True).alias('a_rank'),
pl.col('a').qt.rolling_rank(4, pct=False, rev=True).alias('a_rank2')
)
shape: (7, 3)
┌──────┬──────────┬─────────┐
│ a ┆ a_rank ┆ a_rank2 │
│ --- ┆ --- ┆ --- │
│ f64 ┆ f64 ┆ f64 │
╞══════╪══════════╪═════════╡
│ 5.2 ┆ 1.0 ┆ null │
│ 4.1 ┆ 0.5 ┆ 2.0 │
│ 6.3 ┆ 1.0 ┆ 1.0 │
│ null ┆ null ┆ null │
│ 10.0 ┆ 1.0 ┆ 1.0 │
│ 4.0 ┆ 0.333333 ┆ 3.0 │
│ 5.0 ┆ 0.666667 ┆ 2.0 │
└──────┴──────────┴─────────┘
If-then
df = pl.DataFrame({
'g': ['a', 'a', 'b', 'a', 'b'],
'v': [1, 3, 5, 2, 4],
})
df.select(pl.col('v').qt.if_then((pl.len()>2), pl.col('v')*2).over('g'))
shape: (5, 1)
┌─────┐
│ v │
│ --- │
│ i64 │
╞═════╡
│ 2 │
│ 6 │
│ 5 │
│ 4 │
│ 4 │
└─────┘
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
polars_qt-0.1.1.tar.gz
(15.4 kB
view details)
Built Distributions
File details
Details for the file polars_qt-0.1.1.tar.gz
.
File metadata
- Download URL: polars_qt-0.1.1.tar.gz
- Upload date:
- Size: 15.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: maturin/1.5.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0f2ddc3e76a287884cd93c6c8b81f6c78544a85a64f0bb333182799918a1609 |
|
MD5 | 0b32886c23bbc18902cac40a2c711992 |
|
BLAKE2b-256 | f747e71a4ebb020f6077add42c9e92800a30591758413247971acbbc19b9d598 |
File details
Details for the file polars_qt-0.1.1-cp38-abi3-win_amd64.whl
.
File metadata
- Download URL: polars_qt-0.1.1-cp38-abi3-win_amd64.whl
- Upload date:
- Size: 2.8 MB
- Tags: CPython 3.8+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: maturin/1.5.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dfa76a4c10d83a34b89cae394ec12db29c1db98f336a0f452dfc985a21d05db6 |
|
MD5 | f1c3a9487a156a7cf7c0398a85e5539b |
|
BLAKE2b-256 | 27fa108f10d4b4c0d37314addfe29614c4137471489ae940a9a393ed187c0041 |
File details
Details for the file polars_qt-0.1.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: polars_qt-0.1.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 4.4 MB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: maturin/1.5.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a06d0d24d0da7a3beff04b2f8fd19d6f166805deff31cfefcafd29b7ecf3a310 |
|
MD5 | 0155d639e2261580a4d0aa06c6755c66 |
|
BLAKE2b-256 | fd5b7441839314cc4ba9a9a770d1af15e4b6b87060c639992216482a1723d185 |
File details
Details for the file polars_qt-0.1.1-cp38-abi3-manylinux_2_12_i686.manylinux2010_i686.whl
.
File metadata
- Download URL: polars_qt-0.1.1-cp38-abi3-manylinux_2_12_i686.manylinux2010_i686.whl
- Upload date:
- Size: 4.6 MB
- Tags: CPython 3.8+, manylinux: glibc 2.12+ i686
- Uploaded using Trusted Publishing? Yes
- Uploaded via: maturin/1.5.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0af1ca223bb6916b4fc49cd3e1ee798eea47500417b762269d9799e62b13fce6 |
|
MD5 | 823d4a39617a0aef5e36ac74fbbaf9a9 |
|
BLAKE2b-256 | c951d63a33e5cf83b68b3019f1ff98782c2ca34a8285a088b4b8f18817cc0088 |
File details
Details for the file polars_qt-0.1.1-cp38-abi3-macosx_11_0_arm64.whl
.
File metadata
- Download URL: polars_qt-0.1.1-cp38-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 2.8 MB
- Tags: CPython 3.8+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: maturin/1.5.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 77e6d6973f9ea01658427bdbab2d89a465883d5f9109e1d1f856887792dbf1e4 |
|
MD5 | 47a480664a432f2bd23ad920560df2ae |
|
BLAKE2b-256 | aedd45e043b57500eeadd6a6e7be5a1c7f75acf26e6add85db3c27e557edb9ef |
File details
Details for the file polars_qt-0.1.1-cp38-abi3-macosx_10_12_x86_64.whl
.
File metadata
- Download URL: polars_qt-0.1.1-cp38-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 3.1 MB
- Tags: CPython 3.8+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: maturin/1.5.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6cbadf85e171980e737ab0d3389fe78667ed9fcdc5f37571425ac53419ca0ae |
|
MD5 | fe2fd664328000ef29f1de6c3183d5ce |
|
BLAKE2b-256 | ff619b1a08bcac0a9f91ad53ea37f8a43c46b653b219d9e5693b9f3e6f8f352b |