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

Uploaded Source

Built Distributions

teapy-0.3.0-cp38-abi3-win_amd64.whl (10.3 MB view details)

Uploaded CPython 3.8+ Windows x86-64

teapy-0.3.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (10.5 MB view details)

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

teapy-0.3.0-cp38-abi3-macosx_11_0_arm64.whl (4.8 MB view details)

Uploaded CPython 3.8+ macOS 11.0+ ARM64

teapy-0.3.0-cp38-abi3-macosx_10_7_x86_64.whl (5.7 MB view details)

Uploaded CPython 3.8+ macOS 10.7+ x86-64

File details

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

File metadata

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

File hashes

Hashes for teapy-0.3.0.tar.gz
Algorithm Hash digest
SHA256 4656d8c221a83cac3454551b289ff8630e89f9d728f6c84edab3dc3ab0017bf4
MD5 2a8f949b1ce9f8ea8602722444774e0d
BLAKE2b-256 1fb85c3f3414cc8afe19a8d142348d4f26bb6ce18dfe5ada112cd116210e9e12

See more details on using hashes here.

File details

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

File metadata

  • Download URL: teapy-0.3.0-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 10.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.3.0-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 1116011bec5d84e68c05c4a03442a5e7ad1b41477db512d8a30cef0ad50e184e
MD5 fd1f40a137b3699ae1f1909e9e2c7781
BLAKE2b-256 9e3e78124bb618ab7bfdf2c46de0fb55e5f14586aa81a501408186cd77a81665

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for teapy-0.3.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e970fe926388302d2c76a99c8704e733adace548b6ba728f0a767f8df94c5c59
MD5 7d206da48b52d37b0c04ae7024b9e084
BLAKE2b-256 428c02c67ca4a093c2d403179c0310a8b95682908ba3b2d6f38be6e59681e510

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for teapy-0.3.0-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8fb8afe0062dd865f15dda5e6fd5c44a089301188ea73088abdbe28b8b5c9098
MD5 384ea2bdd968435731bdc52220a396e0
BLAKE2b-256 d594730b9f07f023dae07dbda4833da64f32e2ed5ff47fe0581dd26ac3557d2b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for teapy-0.3.0-cp38-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 f5373491f1a825a5b46e4208a20a26221fa5a6df5136ae058552bc7fc2c608a9
MD5 8be16492bb72cab7013e220b030cdb96
BLAKE2b-256 21882c8ef7dd3afbe530a83728ade950d1e730af3b8518d8dbfd76c56de002a6

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