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 list
e2 = tp.Expr((1, 2, 3))  # Create from tuple
e3 = tp.Expr(np.array([1, 2, 3]), 'e3')  # Create from numpy.ndarray, name is e3
e4 = tp.Expr(pd.Series([1, 2, 3]))  # Create from pandas.Series
e5 = tp.Expr(pl.Series([1, 2, 3]))  # Create from 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 dictionary
dd2 = tp.DataDict([tp.Expr([1, 2], 'a'), tp.Expr([2, 3], 'b')])  # Create from 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.5.tar.gz (185.5 kB view details)

Uploaded Source

Built Distributions

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

Uploaded CPython 3.8+ Windows x86-64

teapy-0.6.5-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.5-cp38-abi3-macosx_11_0_arm64.whl (10.0 MB view details)

Uploaded CPython 3.8+ macOS 11.0+ ARM64

teapy-0.6.5-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.5.tar.gz.

File metadata

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

File hashes

Hashes for teapy-0.6.5.tar.gz
Algorithm Hash digest
SHA256 8554f15982ecd9972a7f31baa97e7cac9e3403530eaf3b0d2edfac773b38efd6
MD5 37a37522e2d463d166373a6d57273565
BLAKE2b-256 5dc4565a0b516a2b976695ce97706d9cae1fc7439bdd0aa5e610be95084d60d1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: teapy-0.6.5-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.5-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 b694e671fd810fe84fd9370e79b9b48a7884454163886e2708e6704e2b6ad078
MD5 562f3c15c5df8a2c78bbe1c85cb33e0e
BLAKE2b-256 513670666c24d29bedcb67f80be2054a84d5a2a7f09717ab7acefc3c748a8dfd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for teapy-0.6.5-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3661385583a067d543781d4dd0d7252f07af33a947325d0a1491dae4b52e5430
MD5 9690154f3e4ef7ee122524d1a7daabb4
BLAKE2b-256 9d2ee1c87ee765bfdab5fd8c71d355156e5028869a8a3f7f5d88dd7a651d3352

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for teapy-0.6.5-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a67096939ffc5be9d0fbf6216c04b8e120858127229c96fc26a41bad755a5f46
MD5 5aa725591d73f0e7e9d425e7f6a829b0
BLAKE2b-256 753dd22195d91a007bd32ca98dbf6842c9c430a7fee6fd817aaf1e052c1bb712

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for teapy-0.6.5-cp38-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 5df8af48109af6e869f5eec0d3b79b18748a88527d8bb3d7bf949ef0ae711b6d
MD5 350804f5b8d15591f41f773d1d61aa06
BLAKE2b-256 7b08b5e5a7d05cee783ab637e40ebe8aa282231a5b706e9cc28d3cd6d0a69fb4

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