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

Uploaded Source

Built Distributions

teapy-0.6.8-cp38-abi3-win_amd64.whl (18.4 MB view details)

Uploaded CPython 3.8+ Windows x86-64

teapy-0.6.8-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.7 MB view details)

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

teapy-0.6.8-cp38-abi3-macosx_11_0_arm64.whl (10.1 MB view details)

Uploaded CPython 3.8+ macOS 11.0+ ARM64

teapy-0.6.8-cp38-abi3-macosx_10_7_x86_64.whl (13.0 MB view details)

Uploaded CPython 3.8+ macOS 10.7+ x86-64

File details

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

File metadata

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

File hashes

Hashes for teapy-0.6.8.tar.gz
Algorithm Hash digest
SHA256 febc7149639d85596dd078ac48fe68ce3ef6c5e21a4b06b6ee19633f25fb2448
MD5 3fb590af5da0a93ec8c5f16985987a5c
BLAKE2b-256 a881a464311fd989528611563ffd44d0e6db317a4d1e9021367edf4af42a7ec2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: teapy-0.6.8-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 18.4 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.8-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 91304c1a00812d03f7ff921d369b13a6d246b174b45658eda89e31f3a17b2440
MD5 f6b597360878cc122ead5a5adc871431
BLAKE2b-256 e7d3cceb0a7607c3fb256164241a11f4e73c3b44283cc9d25ef7b2aefb5d3afa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for teapy-0.6.8-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7dfba974de6d4973d9506a8dd9f8704ecd428cac10b791869744509cf393d609
MD5 ba6c114a0b504485377b88cd160b0edc
BLAKE2b-256 5e678077012f039c0198fcc570c425b88afc47d7d12fd282c26b371caf1051cd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for teapy-0.6.8-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3c8e0ac2e0cd11513eb0dded7639e95ece3384e2592e420f626b609e24079703
MD5 d6bb0ffd9cfd776a48abe4eaf07116e8
BLAKE2b-256 031175322dab8de308581ddcc365f4306e9608503f4ed0d102781e4c50e9987f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for teapy-0.6.8-cp38-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 1573ab1ae66dc96f5900a19981c55068a221d53d8acacdaca462ec4e57953cdb
MD5 52d4be1a754fdf179af77f1c93b1e157
BLAKE2b-256 fb3240bfc283145ed2e91bce8f06194a82203bf20cefb1cea730635353215468

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