Skip to main content

A blazingly fast datadict library

Project description

Teapy

Build PyPI codecov

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


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.4.tar.gz (138.6 kB view details)

Uploaded Source

Built Distributions

teapy-0.2.4-cp38-abi3-win_amd64.whl (9.8 MB view details)

Uploaded CPython 3.8+ Windows x86-64

teapy-0.2.4-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (10.1 MB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ x86-64

teapy-0.2.4-cp38-abi3-macosx_11_0_arm64.whl (4.5 MB view details)

Uploaded CPython 3.8+ macOS 11.0+ ARM64

teapy-0.2.4-cp38-abi3-macosx_10_7_x86_64.whl (5.4 MB view details)

Uploaded CPython 3.8+ macOS 10.7+ x86-64

File details

Details for the file teapy-0.2.4.tar.gz.

File metadata

  • Download URL: teapy-0.2.4.tar.gz
  • Upload date:
  • Size: 138.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.0.1

File hashes

Hashes for teapy-0.2.4.tar.gz
Algorithm Hash digest
SHA256 180788d4e73d5b22fec69898b258c584e12767007320a85620a6076f6b3f0ee7
MD5 3bf64357f2bb06ebeda27a1a524fd4f8
BLAKE2b-256 81a7106451ee1ca69755bc62212abdfacd59ca736350b694c12e89080a9501ed

See more details on using hashes here.

File details

Details for the file teapy-0.2.4-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: teapy-0.2.4-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 9.8 MB
  • Tags: CPython 3.8+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.0.1

File hashes

Hashes for teapy-0.2.4-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 1aacbe6250ae6f48003c2a864b38ea7ad855599e98a3448d61929e6f5fb16ccc
MD5 c3d926627aacd8b2ae7d170149cc8d12
BLAKE2b-256 0a7f6ef8ac2f907dd220da3b3cc4242db4b6e79d29b5e477270a5010639a7526

See more details on using hashes here.

File details

Details for the file teapy-0.2.4-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for teapy-0.2.4-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 10a621238b26bbc066b73e60646e05da9d13356dbd956c7db6aafd2963568f37
MD5 d55f956fba2277dfcd0c7e5a8ac17d31
BLAKE2b-256 827daa7b765213772c8b0a96694fc147023c41fdbf6997feda1f572a55a60f6d

See more details on using hashes here.

File details

Details for the file teapy-0.2.4-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for teapy-0.2.4-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c61c8638d69ec15db6ccbc3ed9d649ea26f00b0d2232a469f1ed83f857500b17
MD5 dd99d70a2d80e3a56664f2d3ad7a4cc3
BLAKE2b-256 47a74b80a1c14ff575b8d9d1efb16adf735a57d11d674bc407942c8f0143f800

See more details on using hashes here.

File details

Details for the file teapy-0.2.4-cp38-abi3-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for teapy-0.2.4-cp38-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 e2bf5f378ecf952f58536af3254ae62c9d03f03bae791bfa52b5de411444d542
MD5 4a65c93509ec5c935ae02b953e46d5d5
BLAKE2b-256 3781ed74ab18fcdddc925b736c751708f32d9d2f0a159de04bcd7f01addc3e75

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page