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.2.7.tar.gz
(140.0 kB
view details)
Built Distributions
File details
Details for the file teapy-0.2.7.tar.gz
.
File metadata
- Download URL: teapy-0.2.7.tar.gz
- Upload date:
- Size: 140.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.0.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0663be43289ed1f42f447485d6bda55a363595f7cff1b82d0738ffbc9e08234 |
|
MD5 | 92bdaaa06a7e62755f41bf157a79abf6 |
|
BLAKE2b-256 | 7e3e9b8b85b487f48c6f39171434f8ec0acc788e28a33ad914d8f1b6d30efe1e |
File details
Details for the file teapy-0.2.7-cp38-abi3-win_amd64.whl
.
File metadata
- Download URL: teapy-0.2.7-cp38-abi3-win_amd64.whl
- Upload date:
- Size: 10.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 | 118b1c932c83da335ced2295b6f05bb9564dca9008f23cee1d60a84aad8fb9b7 |
|
MD5 | 0bb452dd3a1412ff127563a777483bd6 |
|
BLAKE2b-256 | b013cec3613a72b7f9cae87d04480c35770ff87f80ff4bb840409cca83db9fe3 |
File details
Details for the file teapy-0.2.7-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: teapy-0.2.7-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 10.4 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 | 1e75fedd10db3cb1ec486af5cc1cec969a79035b37b2a91f9882577925737a0e |
|
MD5 | a1c3203b4f996b61a745883f7aa2cc33 |
|
BLAKE2b-256 | 613d6c8098fb3bcc68b136cfa06dd8a839fb53fb5e871824d1668ad312070efe |
File details
Details for the file teapy-0.2.7-cp38-abi3-macosx_11_0_arm64.whl
.
File metadata
- Download URL: teapy-0.2.7-cp38-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 4.7 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 | 6a31039d46085e022ff6ad08be915147ed3875a336df66e13879ba892234d758 |
|
MD5 | f36196d567b1b751787859b0aafb9692 |
|
BLAKE2b-256 | d8fec6c003aae7987dfce1fa0905f889dc4f751fa548cd04dcef462b2582183e |
File details
Details for the file teapy-0.2.7-cp38-abi3-macosx_10_7_x86_64.whl
.
File metadata
- Download URL: teapy-0.2.7-cp38-abi3-macosx_10_7_x86_64.whl
- Upload date:
- Size: 5.6 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 | fc55489984ddb3f6659c242832003d44f886f19e50aff973b17a525ec01e19eb |
|
MD5 | 97b87f18f0a15b6b9877ed682d7ec663 |
|
BLAKE2b-256 | 33742eba4ff24686d27aa3266f07763e043e52d9dd21a177e9d50310e918f768 |