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 list
e2 = tp.Expr((1, 2, 3)) # Create from tuple
e3 = tp.Expr(np.array([1, 2, 3]), 'e3') # Create from numpy.ndarray, name is e3
e4 = tp.Expr(pd.Series([1, 2, 3])) # Create from pandas.Series
e5 = tp.Expr(pl.Series([1, 2, 3])) # Create from 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 dictionary
dd2 = tp.DataDict([tp.Expr([1, 2], 'a'), tp.Expr([2, 3], 'b')]) # Create from 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 Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file teapy-0.9.0-cp38-abi3-win_amd64.whl.
File metadata
- Download URL: teapy-0.9.0-cp38-abi3-win_amd64.whl
- Upload date:
- Size: 13.2 MB
- Tags: CPython 3.8+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3b64c1b273c3eed9506c9ba2fd6041ba81d8e2c1ede5d380437f90ab30679296
|
|
| MD5 |
bf898a700909bdcfde4bbe28e2641443
|
|
| BLAKE2b-256 |
d0059b8a0edd9e502bde4f63c6d25e63b9f1f8bb0b334608cd0cc1a94951e9a4
|
File details
Details for the file teapy-0.9.0-cp38-abi3-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: teapy-0.9.0-cp38-abi3-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 15.9 MB
- Tags: CPython 3.8+, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95bbc3bb3f3d2cca07d09fd45219f74bb684fcdebfb0b37a1f24e51049a51867
|
|
| MD5 |
a3367b9870ff2f664bfe329b1abc12ff
|
|
| BLAKE2b-256 |
1bca6318eef10fe763a4ec22211f76381dc39029abe82273fb80773b8a5f3dd7
|
File details
Details for the file teapy-0.9.0-cp38-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: teapy-0.9.0-cp38-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 9.1 MB
- Tags: CPython 3.8+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a408c5b502a0d51d8f9ed2b69ab3bcf58da791e5ad5da9fb495feabc199b23c
|
|
| MD5 |
d1cb0cd5c92544fec0494a1b63689e08
|
|
| BLAKE2b-256 |
6ad77c3640ee91af055f139cf5bb202a417b419dcb52f41cfd155c1826c8425d
|