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

Uploaded Source

Built Distributions

teapy-0.4.5-cp38-abi3-win_amd64.whl (11.2 MB view details)

Uploaded CPython 3.8+ Windows x86-64

teapy-0.4.5-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.3 MB view details)

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

teapy-0.4.5-cp38-abi3-macosx_11_0_arm64.whl (5.0 MB view details)

Uploaded CPython 3.8+ macOS 11.0+ ARM64

teapy-0.4.5-cp38-abi3-macosx_10_7_x86_64.whl (6.6 MB view details)

Uploaded CPython 3.8+ macOS 10.7+ x86-64

File details

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

File metadata

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

File hashes

Hashes for teapy-0.4.5.tar.gz
Algorithm Hash digest
SHA256 91d2bfd1ac77c36487c9e01534d6a0492893d8048480dc152acf9f24e885da5f
MD5 2010c7afbde06a9a9c79e01e45b4745f
BLAKE2b-256 468f33ad1716a948390f2dd57c8c945c1bbb10cb07776faf882a9f79eb568875

See more details on using hashes here.

File details

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

File metadata

  • Download URL: teapy-0.4.5-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 11.2 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.5-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 7d78d0d0449cd01eb4b6893e887e300c4bc1d588ab74e6d70cf9d1c1815815e8
MD5 75249c6446691524e776a52368043638
BLAKE2b-256 4c1fe2dee5ea99820fb57a57a0795ef6bf480dcd8ee9da906f49d77b5498c906

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for teapy-0.4.5-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 40caecc3acd21533d570412b61445bf28075279410e39c756702ff14726175ec
MD5 9bc10364989068a2c13d007caa6d3960
BLAKE2b-256 a2d7c8ddebb427f4c45fca432b04316fc5937c71ef82f63ce048aee7f61521ee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for teapy-0.4.5-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7e1e39b16e89311b343bfe54192dab4db9be3308b47455782372e811a1c57fe7
MD5 1fe8682032ee359a9a4f66a0a5e74917
BLAKE2b-256 51c5d14023e0219229813a8fe504dcea875f6d2c92698d484621a745f9806f10

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for teapy-0.4.5-cp38-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 51a9d7eed4478b38133d396ff3dcc04a7eaf02d6a6064206356ff7e8ee7071db
MD5 05a61297da41e8f9837d58138cbac4fa
BLAKE2b-256 c03708605bbfa0acc56c18c9369da2bccbe8ff4fe8ee2acfb48e5d67f168f78f

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