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

Uploaded Source

Built Distributions

teapy-0.4.19-cp38-abi3-win_amd64.whl (12.3 MB view details)

Uploaded CPython 3.8+ Windows x86-64

teapy-0.4.19-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.4 MB view details)

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

teapy-0.4.19-cp38-abi3-macosx_11_0_arm64.whl (6.0 MB view details)

Uploaded CPython 3.8+ macOS 11.0+ ARM64

teapy-0.4.19-cp38-abi3-macosx_10_7_x86_64.whl (7.7 MB view details)

Uploaded CPython 3.8+ macOS 10.7+ x86-64

File details

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

File metadata

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

File hashes

Hashes for teapy-0.4.19.tar.gz
Algorithm Hash digest
SHA256 f3e018d9a3dd8dc7a6f17a99040af60e6d740c2dfbc270ae42bea4efe481b668
MD5 e1da17ae094c2a57685bb99547e52c40
BLAKE2b-256 416e5e68e2c1946f1a312b9a63594c6c04ce0293483b7a46e0d9dc8fba5af91a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: teapy-0.4.19-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 12.3 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.4.19-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 2aea4d82ce5cecbdcf66775300355ecf1ad8459fc4d60b329331f134a6b0d852
MD5 3036d8be52d9f01c510181ce7b8dc9c1
BLAKE2b-256 f9685eb192c93f709fde3f893f5d798f0d8e22cde576a6e51c3174c89550d055

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for teapy-0.4.19-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f84c7ff8789f22cb2b5e615f1a0a49574835a2d03f2b1694d4b1c2d4979f3291
MD5 027dafa23375d4d152f05d1d830125bf
BLAKE2b-256 d170ced38bda03df061a9659fb23110e0bf0ea52f456cc6af95ed6192bb0fda5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for teapy-0.4.19-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 48823100c13003174ca0b881aa946e331518a0b967e79b1a7565436730d48223
MD5 abb8f1a726878d7391e4878f5a84fe14
BLAKE2b-256 31516b3d1cdc1844e270c398f2889fb7f910dbdde8cf98155244af84a3f25594

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for teapy-0.4.19-cp38-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 11ce501d9ae222adcfb1c249b0d806a8f0637def3e2d188c9867ac77b8bb7fb5
MD5 ac30581b1b080fa40f6e365462164d7b
BLAKE2b-256 2636741c5918fb59ad2d10c8f52d0216fed6e6c5ae8190f68c12b1bd2f114c10

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