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.11.tar.gz
(156.1 kB
view details)
Built Distributions
File details
Details for the file teapy-0.4.11.tar.gz
.
File metadata
- Download URL: teapy-0.4.11.tar.gz
- Upload date:
- Size: 156.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.0.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc7aed2fd5ea894ec311bd0037f1199c1e51618d10ed4b316da8e6caf597df2c |
|
MD5 | 7ee4bb5abcbd9c1012a4d30e40d1e3d2 |
|
BLAKE2b-256 | 3f36709e89c78a7f03de7da547193f7c131855f95d9be1ffb51724584c5c8afe |
File details
Details for the file teapy-0.4.11-cp38-abi3-win_amd64.whl
.
File metadata
- Download URL: teapy-0.4.11-cp38-abi3-win_amd64.whl
- Upload date:
- Size: 11.9 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 | de7866ca1a205eea3e1f00c6e4e58753f01aa619e2aecb82c6b3b7979518fa73 |
|
MD5 | 3b307dcdbbb3c70e88acd39cea044ec9 |
|
BLAKE2b-256 | 4f8aa137f516c1794c31dc15cc8ac8850324896b7361119fbe50df4ff23fba91 |
File details
Details for the file teapy-0.4.11-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: teapy-0.4.11-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 11.8 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 | d43edfcdbf1b681c616e1e6afcf910eddefcf125a62388265e3c83bf12905a86 |
|
MD5 | 2bb1c37c1598d760cc070f2445ff9801 |
|
BLAKE2b-256 | 177f50a4da3c2e0c1944b0b85af811ae3fc72711b7e6c33e25abab9eb38df529 |
File details
Details for the file teapy-0.4.11-cp38-abi3-macosx_11_0_arm64.whl
.
File metadata
- Download URL: teapy-0.4.11-cp38-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 5.6 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 | 0ce8be31326872969e44cff66c4552fc941326667c40a3566de4234d19aef3c5 |
|
MD5 | e1afffca364f67a494872f4cd300e62f |
|
BLAKE2b-256 | b0a781fb5064665c24a8724bce07b44f915d7fe9a2ea02ad42e8f226234e23c1 |
File details
Details for the file teapy-0.4.11-cp38-abi3-macosx_10_7_x86_64.whl
.
File metadata
- Download URL: teapy-0.4.11-cp38-abi3-macosx_10_7_x86_64.whl
- Upload date:
- Size: 7.1 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 | e4e6fda97d205ff91cacc2bd0dcbe58a5cdd2ff35ac10befa00dc4640b0d40da |
|
MD5 | 7c324c4ad00478c087726d175acf799b |
|
BLAKE2b-256 | c6f5b51f826b402222e7079d3536d8b1f6d40be174ef55f4efd9e6f9a7427e17 |