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.10.tar.gz
(156.2 kB
view details)
Built Distributions
File details
Details for the file teapy-0.4.10.tar.gz
.
File metadata
- Download URL: teapy-0.4.10.tar.gz
- Upload date:
- Size: 156.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.0.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 801c8e7ea2a813a5e2034d68d26f73528cf4c18d1e7b23bb61eb4f1462bf7fa9 |
|
MD5 | ec3b582695fe7a183e517aca979b8a2d |
|
BLAKE2b-256 | 5716ad6e82688b5a4d85182cfb82f3df94921d1fa12f71848b6854b4c1ce56dc |
File details
Details for the file teapy-0.4.10-cp38-abi3-win_amd64.whl
.
File metadata
- Download URL: teapy-0.4.10-cp38-abi3-win_amd64.whl
- Upload date:
- Size: 11.8 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 | 77c84808d2953543ad1af0e30ec2f4bcb14ec92c1e8cdd6dcd15cbcbffd177b5 |
|
MD5 | b5456b9e20a7488114bc0e7a833f241a |
|
BLAKE2b-256 | 1e7c6fb0cd90ad15e6cf693d952d3309f45247a4431f40e1b814ef521c307615 |
File details
Details for the file teapy-0.4.10-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: teapy-0.4.10-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 11.7 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 | 8a97e583ceb6fe6d0407051616687ba514e727919b8fb8c7266471791c3fac00 |
|
MD5 | 2e1ff302c8406c2f166c2241a8069fc5 |
|
BLAKE2b-256 | d97cbed03c9b8c5a44b59897ef206e5fc5f080d6aae432847b38198cb7c84306 |
File details
Details for the file teapy-0.4.10-cp38-abi3-macosx_11_0_arm64.whl
.
File metadata
- Download URL: teapy-0.4.10-cp38-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 5.5 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 | dd9dfe7d9e0026aed8226f1ecd7a0bc15d36ca4d0351c137d964bbf7849ca913 |
|
MD5 | b46ffe1d75d58bd2cf6af79ab119672b |
|
BLAKE2b-256 | db7cb3e3d802c8cdca4cc7701bd23349f1d7194b456a04ca32e2c7ee750fc24f |
File details
Details for the file teapy-0.4.10-cp38-abi3-macosx_10_7_x86_64.whl
.
File metadata
- Download URL: teapy-0.4.10-cp38-abi3-macosx_10_7_x86_64.whl
- Upload date:
- Size: 7.0 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 | 2e5afbb37322a6d1c803d4bbbbe1698a8374d55c4a47fb4ab840e2e47d9f8954 |
|
MD5 | 38b10fb1a7eef6fb2134bcb9ecb63cbf |
|
BLAKE2b-256 | d8ab44803c9e052fbf962165d48051c3bf7d9395af7f4224968d29a0bec6e778 |