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

Uploaded Source

Built Distributions

teapy-0.5.1-cp38-abi3-win_amd64.whl (12.8 MB view details)

Uploaded CPython 3.8+ Windows x86-64

teapy-0.5.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.6 MB view details)

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

teapy-0.5.1-cp38-abi3-macosx_11_0_arm64.whl (6.7 MB view details)

Uploaded CPython 3.8+ macOS 11.0+ ARM64

teapy-0.5.1-cp38-abi3-macosx_10_7_x86_64.whl (8.8 MB view details)

Uploaded CPython 3.8+ macOS 10.7+ x86-64

File details

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

File metadata

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

File hashes

Hashes for teapy-0.5.1.tar.gz
Algorithm Hash digest
SHA256 7237e8cab28415068dbfea670379bd665ccc6a8c0c4dffc4ff0baba5e6667d4c
MD5 78be083f8b2d1ad07699098189102ada
BLAKE2b-256 dec3f8176289ac6153afd69105249078b06be227bfa1a7aebb2b6577414a5758

See more details on using hashes here.

File details

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

File metadata

  • Download URL: teapy-0.5.1-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 12.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.5.1-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 5d99d513adee9a31d94c9f67a99b9e409fe46164652322bc20d79016e0f87e72
MD5 39d48ad16a16bf47a437ac15d6b8fc7f
BLAKE2b-256 353f4462960ccb713625c52d96a53f7ea7b18ce0d652506a2be0908dc9f7989a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for teapy-0.5.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 dcd4acb75b2406764019b0639f1013930ff3a037b5f85e776a4bc7f242a5a348
MD5 dbdc9fc044cee93931b667bef9a7947b
BLAKE2b-256 3037e1b63fd0ffa12c57dfc93bd5a8f948cf64c3657b6914aa5913294572c361

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for teapy-0.5.1-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5e52c42b8fb3f8046c6d6b2fbfd46436f15e95322fe9345bd8168e3ba29beeda
MD5 43048ecca0ceb5d6b53f5a377e4c9eff
BLAKE2b-256 02aab523c8c906498f629331a9582df43f6d65f1596140ad6f55d46d63d61712

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for teapy-0.5.1-cp38-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 5d86237be27c5973f3d47d153316b38d403529a8d15652a294f9f59a57f39ad7
MD5 7f8015647b62cff4c3456a8ee228cbd0
BLAKE2b-256 99ff4481769ab11af2aedd99c7cfebebd2f31e9a7c8e71a5ae77c30a7e05fa8d

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