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

Uploaded Source

Built Distributions

teapy-0.6.4-cp38-abi3-win_amd64.whl (18.1 MB view details)

Uploaded CPython 3.8+ Windows x86-64

teapy-0.6.4-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.5 MB view details)

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

teapy-0.6.4-cp38-abi3-macosx_11_0_arm64.whl (10.0 MB view details)

Uploaded CPython 3.8+ macOS 11.0+ ARM64

teapy-0.6.4-cp38-abi3-macosx_10_7_x86_64.whl (12.8 MB view details)

Uploaded CPython 3.8+ macOS 10.7+ x86-64

File details

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

File metadata

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

File hashes

Hashes for teapy-0.6.4.tar.gz
Algorithm Hash digest
SHA256 fbeb126ac89a723910690a591a167acdf16b7cf0ce3dd2710f15db3a889fa38f
MD5 b3a7f5d243f845667d7e489ac45edf6b
BLAKE2b-256 1a89e9536279fa66e3aadd77319f4b03500f92d0cf01514c0ed78829de31802f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: teapy-0.6.4-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 18.1 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.6.4-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 ae7c2180ede1de79f3a684ccff1ee82451b2359f6b7b6ec1476853aa98e154da
MD5 cc9aaa87d42d8da1fdbbd6d702967086
BLAKE2b-256 bb58702a18a835eb094e33b8564333b8d47ee907a43fd316736065a8a1ce03b4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for teapy-0.6.4-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7a8ae4a494d3385a218d32c4b5962db1e4673e8df9d6dfb5e4044a3a3e423718
MD5 17bb93e9384d0a28b6ef468ecec0f255
BLAKE2b-256 65e16485e7e7002d75d89c81767da08a93a2fda7777b041717e100ab70764de9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for teapy-0.6.4-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 adffe38bf7393093b3f77b5850615a9ece431ff54c6a257ae43b5ec8b8d1f17e
MD5 fa2482886cee7bb6cb15b98321352ccd
BLAKE2b-256 4e8f774bcd3482a3d05eceedecd3274aae7b39bc7c90bd9a24bbe37bc8f5b122

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for teapy-0.6.4-cp38-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 f09563421a3530549eef339ac2c81167cc7cb233fde4bb8fc5741dbfa6167f70
MD5 a4ac1eb9f79e57790e2ae3f1c84a926a
BLAKE2b-256 996668b718b068e3be7b6d124153383a28bb8c760962a8dffd3af5be53f02be4

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