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

Uploaded Source

Built Distributions

teapy-0.4.1-cp38-abi3-win_amd64.whl (10.9 MB view details)

Uploaded CPython 3.8+ Windows x86-64

teapy-0.4.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.1 MB view details)

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

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

Uploaded CPython 3.8+ macOS 11.0+ ARM64

teapy-0.4.1-cp38-abi3-macosx_10_7_x86_64.whl (6.4 MB view details)

Uploaded CPython 3.8+ macOS 10.7+ x86-64

File details

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

File metadata

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

File hashes

Hashes for teapy-0.4.1.tar.gz
Algorithm Hash digest
SHA256 83017c6660511297ac5a0aa41a3be38ce6cc440ff0525629bd10b3ca525bd757
MD5 885e2735c0977fbfe2c487c721700da9
BLAKE2b-256 e7cd752ebd9f705fc79d56c23bbdc563bad090c902e926cd55ff504ca42273a9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: teapy-0.4.1-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 10.9 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.1-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 3c9d361c1e28e3d3499a17d68843a2a4f59bc3557e2c065c99d8dbb6bda40c35
MD5 f81a52cd8a7ce258bfbd5eab2688f56c
BLAKE2b-256 fb918b59df5420966dd8776f6f7a8d19a1d0416c21fc0fadfaa6d20ac250fe69

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for teapy-0.4.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b6d959b7bee6c95e1a90283beb9c9623dc1fbe9f25afd61b61d449deb82c2120
MD5 ad43931a0b442e9bd7df8deb6dc1be91
BLAKE2b-256 1f1531d04a6a79de43c066895110102b3dfaa4981004430d4a9528bbac304dc8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for teapy-0.4.1-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ef61114e7bb411aa500acfb0bad388cd7c3cafdd4c0e7787499d3b71aa272649
MD5 ebe9077972240830509ec39b0022429d
BLAKE2b-256 083a28a2b6bb24f19839fd02629ca946739fded70171223bdc1e67b9d7ad941d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for teapy-0.4.1-cp38-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 5030bb0cc089f91631f56e4eadc6aaa4ce0ed1202ad83cc55f4fe48576d48a52
MD5 105c7c3e37d0ac2ed973821f4aa0d689
BLAKE2b-256 ecff46bcc8d5c984109b2ae72b0f7fe0e3f91a859495fb87b80151bb1561a037

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