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.15.tar.gz
(158.7 kB
view details)
Built Distributions
File details
Details for the file teapy-0.4.15.tar.gz
.
File metadata
- Download URL: teapy-0.4.15.tar.gz
- Upload date:
- Size: 158.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.0.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38b4ae842caf0cec4659c21d024a679ca130538695d8fdd9f9970069fc7e0d4f |
|
MD5 | 2225586569916c62527f343fa269ac0c |
|
BLAKE2b-256 | ebb225e5ad7b69e29f5c7d5a6f59c5a698dab9504e78a4f5234dcda85d49da0f |
File details
Details for the file teapy-0.4.15-cp38-abi3-win_amd64.whl
.
File metadata
- Download URL: teapy-0.4.15-cp38-abi3-win_amd64.whl
- Upload date:
- Size: 12.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 | a3241e3849e665b37a4cdce7f104dbe68bb44fe63433d3a1aa2916310b9cae0f |
|
MD5 | 250e5e40520d03570d9349ff97da3cb2 |
|
BLAKE2b-256 | a21777308e6096d9abb85f22bda6cd2db72ba78fa73fd8c5c30237580e6ed0f0 |
File details
Details for the file teapy-0.4.15-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: teapy-0.4.15-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 12.2 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 | c3e99b97e35b881ff16df6b2f74a886b62f40a08016d6014c3ce39874cb3db8b |
|
MD5 | f612a2f348dfc9e25beae09661ba51a8 |
|
BLAKE2b-256 | 696c16550128738f4899924569429491bfbb076fc14a302737f410d7a2a212c1 |
File details
Details for the file teapy-0.4.15-cp38-abi3-macosx_11_0_arm64.whl
.
File metadata
- Download URL: teapy-0.4.15-cp38-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 5.8 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 | e6f48954586304ef2e8ed9a89741ec9d10f2c6ccb2d3e6056051777d62cf14e2 |
|
MD5 | 434cdfa837076dad8b12e3135118eddd |
|
BLAKE2b-256 | 6759451157fc49d50e09083fea11ec5b4477d7a7854785121792a846df01012b |
File details
Details for the file teapy-0.4.15-cp38-abi3-macosx_10_7_x86_64.whl
.
File metadata
- Download URL: teapy-0.4.15-cp38-abi3-macosx_10_7_x86_64.whl
- Upload date:
- Size: 7.4 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 | 3c18a74506b6a7a80ddc528f966bead1f7f3c3c3301c44bec5b3155ba7eab209 |
|
MD5 | 76519bf4b1161c26f2f72b240840eaa9 |
|
BLAKE2b-256 | b7dd0af84cc82179048bfe2a6975897610e3c681e7e94a4188f75cc63df5143a |