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

Uploaded Source

Built Distributions

teapy-0.8.2-cp38-abi3-win_amd64.whl (15.3 MB view details)

Uploaded CPython 3.8+ Windows x86-64

teapy-0.8.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (15.6 MB view details)

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

teapy-0.8.2-cp38-abi3-macosx_11_0_arm64.whl (8.5 MB view details)

Uploaded CPython 3.8+ macOS 11.0+ ARM64

teapy-0.8.2-cp38-abi3-macosx_10_12_x86_64.whl (10.5 MB view details)

Uploaded CPython 3.8+ macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: teapy-0.8.2.tar.gz
  • Upload date:
  • Size: 196.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.7.0

File hashes

Hashes for teapy-0.8.2.tar.gz
Algorithm Hash digest
SHA256 2b5a3ef0c6ccc993a9b44278430ab5f7ff123e925485504cdc570258af9ee1fe
MD5 e4b6fb65af039186fc8b43b5ecc756b7
BLAKE2b-256 6154dd46356daa5816a7803d194eb9f083d1b80ef32d0dc43735399557e94c09

See more details on using hashes here.

File details

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

File metadata

  • Download URL: teapy-0.8.2-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 15.3 MB
  • Tags: CPython 3.8+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.7.0

File hashes

Hashes for teapy-0.8.2-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 356bc96e94c1675bfa3478f20ca8c2adc55d527e6ecd60e9cb05781930b16d1a
MD5 c9e0bca94d7855f77e0f91b751570b78
BLAKE2b-256 628255da0b062dae4970af6965fcd8651a8adcf39b9d90b2a91313a40568f4ce

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for teapy-0.8.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 360683e5a16640d9c6bf19d6684c032d4fc14badfbdef5ec108723a5464fc5ab
MD5 f8f98c1cbdaf189f1c6f438773a880bd
BLAKE2b-256 a77e1f68c3d851512d0e366f7a2cfb244fc61426226f99df38a2c6e47e281b92

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for teapy-0.8.2-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f26642728f3c148c4f8072106ccf6adcf7eee15ba88a6e3164ab099b0e609326
MD5 a09d5bb532822d4f9d60064e40427ebc
BLAKE2b-256 56a9669a9c247e72e176a780d2cbea26dc1cc612e108e624ce3763e76a42d89d

See more details on using hashes here.

File details

Details for the file teapy-0.8.2-cp38-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for teapy-0.8.2-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 7b324ab349147768056efc186a3e4e08b182a0fffe3080c623aa370bc0dd4d0f
MD5 c6e89924000155b3486527e64818843e
BLAKE2b-256 3ca2de2c76be5448416d0b8ea97e2509935e4bce097dcf77a0604538be840f61

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