A blazingly fast datadict library
Project description
Teapy
Blazingly fast datadict library in Python
Teapy is a high-performance data dictionary library implemented in Rust, designed for blazingly fast operations. It offers the following features:
- Lazy evaluation
- Handling of NaN values
- Multi-threaded processing
- Support for any dimensionality
Setup
Install the latest teapy version with:
pip install teapy
Basic Usage
Creating Expressions
# Expressions can be created in various ways
import numpy as np
import pandas as pd
import polars as pl
import teapy as tp
e1 = tp.Expr([1, 2, 3]) # Create from a list
e2 = tp.Expr((1, 2, 3)) # Create from a tuple
e3 = tp.Expr(np.array([1, 2, 3]), 'e3') # Create from a numpy.ndarray, name is e3
e4 = tp.Expr(pd.Series([1, 2, 3])) # Create from a pandas.Series
e5 = tp.Expr(pl.Series([1, 2, 3])) # Create from a polars.Series
Creating DataDicts
# DataDicts can be created in different ways
dd1 = tp.DataDict({'a': [1, 2], 'b': [2, 3]}, c=[3, 4]) # Create from a dictionary
dd2 = tp.DataDict([tp.Expr([1, 2], 'a'), tp.Expr([2, 3], 'b')]) # Create from a list of expressions
dd3 = tp.DataDict(a=[1, 2], b=[2, 3], c=np.array([3, 6, 2])) # Create by specifying key-value pairs
Evaluating Expressions and DataDicts
# Evaluating Expressions
e = tp.Expr([1, 2, 3]).mean()
e.eval() # Execute the expression
e.view # View the memory of the array
e.eview() # Execute the expression and view the memory of the array
e.value() # Execute the expression and copy the memory of the array to a new numpy.ndarray
# Evaluating DataDicts
dd = tp.DataDict({'a': [1, 2]*10, 'b': [2, 3]*10}, c=[3, 4])
dd = dd.select([
dd['a'].ts_mean(3).alias('d'),
dd['b'].ts_std(4).alias('e')
])
dd.eval(['d', 'e']) # Evaluate specific keys in parallel
dd.eval() # Or evaluate all expressions in parallel
print(dd['d'])
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
teapy-0.4.4.tar.gz
(145.9 kB
view details)
Built Distributions
File details
Details for the file teapy-0.4.4.tar.gz
.
File metadata
- Download URL: teapy-0.4.4.tar.gz
- Upload date:
- Size: 145.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.0.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4cd0be252ac08b21310242792b2a672129b436b85ae8f5d84250d441a96725c5 |
|
MD5 | 0fe4140a0b3476d3b01b3c8aa0397a4a |
|
BLAKE2b-256 | 02c067a8f6182b517a1c11607023e9f3cd309462dc5093d7ded66ed26a228144 |
File details
Details for the file teapy-0.4.4-cp38-abi3-win_amd64.whl
.
File metadata
- Download URL: teapy-0.4.4-cp38-abi3-win_amd64.whl
- Upload date:
- Size: 11.2 MB
- Tags: CPython 3.8+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.0.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9267fc3deac093297020fcb471005cf35f076c541d3d534cadc1878a9f79f312 |
|
MD5 | c4dafe113038ec47f00d40370260d835 |
|
BLAKE2b-256 | eb383be6d22257cd1a6bd229e56e002effd8465a58d807cc92d5b1e9a9a9d8a9 |
File details
Details for the file teapy-0.4.4-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: teapy-0.4.4-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 11.3 MB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.0.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 912393a1727cbd57ec96960c9fdc4da5bff7d183a9a5d14e194c129c89fe2596 |
|
MD5 | cb739ffbccd771ae4907210abed9fabc |
|
BLAKE2b-256 | 4911af83563808429a3075c10fcaf557feaa8acbf8cffdc84ed363e8ec5b9887 |
File details
Details for the file teapy-0.4.4-cp38-abi3-macosx_11_0_arm64.whl
.
File metadata
- Download URL: teapy-0.4.4-cp38-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 5.0 MB
- Tags: CPython 3.8+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.0.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ddb0065e1f67fa189cf2ed5d441fe0100c64300c63373410c10661bdcb292d4 |
|
MD5 | 3bfd6a7ab7913c1373a0ee9d226288bd |
|
BLAKE2b-256 | bba12d11d0e45a78f5f5c547f813d23b9c24d9f832f9b76f83ffa4b45f645b59 |
File details
Details for the file teapy-0.4.4-cp38-abi3-macosx_10_7_x86_64.whl
.
File metadata
- Download URL: teapy-0.4.4-cp38-abi3-macosx_10_7_x86_64.whl
- Upload date:
- Size: 6.7 MB
- Tags: CPython 3.8+, macOS 10.7+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.0.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3956bff406332e998cb2a5dd306a1f4de0a5bc3f1a88fda39cf3169b1bd599e0 |
|
MD5 | 574b0fd80c37238cda2d2b47ea2d5aaf |
|
BLAKE2b-256 | 535edffa6247324f68545a779bc0ecf2bdf94f636c229ba13e514badfd260032 |