Skip to main content

No project description provided

Project description

incstatspy

A Python C extension for efficiently calculating statistics iteratively on NumPy arrays. This module provides functions for computing mean, variance, skewness, kurtosis, and central moments.

Status

Build Status codecov PyPI - Version

Features

  • Compute running mean, variance, skewness, and kurtosis.
  • Calculate central moments up to a specified order.
  • Calculate standardized central moments up to a specified order.
  • Determine minimum and maximum values.
  • Designed for efficiency and simplicity.
  • Handles weighted data points.
  • Iterative update functionality when calling on multiple ndarrays of compatible shape.

Installation

You can install this project using pip:

Using pip

To install the latest version from PyPI:

pip install incstatspy

From Source

If you want to install the project from the source code:

git clone https://github.com/borchehq/incstatsPy.git
cd incstatspy
pip install .

Usage

import incstatspy
import numpy as np


# Calculate mean
ndarray = np.array(np.random.rand())
mean, buffer = incstatspy.mean(ndarray)
print(mean)
# Update mean with new data
ndarray = np.array(np.random.rand())
print(mean)
mean, buffer = incstatspy.mean(ndarray, buffer=buffer)
# Calculate variance
ndarray = np.array(np.random.rand())
# Mean will be automatically calculated with variance
mean, variance, buffer = incstatspy.variance(ndarray)
print(variance)
ndarray = np.array(np.random.rand())
# Update mean and variance
mean, variance, buffer = incstatspy.variance(ndarray, buffer=buffer)
print(variance)
ndarray = np.random.rand(3, 3)
# Calculate skewness (variance and mean will be automatically calculated as well)
*_, skewness, buffer = incstatspy.skewness(ndarray) # discard mean and variance
print(skewness)
ndarray = np.random.rand(3, 3)
# Update skewness
*_, skewness, buffer = incstatspy.skewness(ndarray, buffer=buffer)
print(skewness)
ndarray = np.random.rand(3, 3)
# Calculate kurtosis (skewness, variance and mean will be automatically calculated as well)
*_, kurtosis, buffer = incstatspy.kurtosis(ndarray) # discard mean, variance and skewness
print(kurtosis)
ndarray = np.random.rand(3, 3)
# Update kurtosis
*_, kurtosis, buffer = incstatspy.kurtosis(ndarray, buffer=buffer)
print(kurtosis)
# Calculate 8th moment and discard lower moments. Mean will be calculated as well.
# Calculate along axis 1 (default: axis 0)
p = 8
ndarray = np.random.rand(3, 3)
*_, pth_moment, mean, buffer = incstatspy.central_moment(ndarray, p, axis=1)
print(pth_moment)
ndarray = np.random.rand(3, 3)
# Update 8th moment
*_, pth_moment, mean, buffer = incstatspy.central_moment(ndarray, p, axis=1, buffer=buffer)
print(pth_moment)

License

This project is licensed under the Apache License, Version 2.0. You may obtain a copy of the License at:

http://www.apache.org/licenses/LICENSE-2.0

The full text of the license is available in the LICENSE.txt file in this repository.

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

incstatspy-0.3.1.tar.gz (16.1 kB view hashes)

Uploaded Source

Built Distributions

incstatspy-0.3.1-pp310-pypy310_pp73-win_amd64.whl (35.3 kB view hashes)

Uploaded PyPy Windows x86-64

incstatspy-0.3.1-pp310-pypy310_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (30.3 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

incstatspy-0.3.1-pp310-pypy310_pp73-macosx_11_0_arm64.whl (29.6 kB view hashes)

Uploaded PyPy macOS 11.0+ ARM64

incstatspy-0.3.1-pp310-pypy310_pp73-macosx_10_15_x86_64.whl (30.5 kB view hashes)

Uploaded PyPy macOS 10.15+ x86-64

incstatspy-0.3.1-pp39-pypy39_pp73-win_amd64.whl (35.3 kB view hashes)

Uploaded PyPy Windows x86-64

incstatspy-0.3.1-pp39-pypy39_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (30.2 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

incstatspy-0.3.1-pp39-pypy39_pp73-macosx_11_0_arm64.whl (29.6 kB view hashes)

Uploaded PyPy macOS 11.0+ ARM64

incstatspy-0.3.1-pp39-pypy39_pp73-macosx_10_15_x86_64.whl (30.4 kB view hashes)

Uploaded PyPy macOS 10.15+ x86-64

incstatspy-0.3.1-pp38-pypy38_pp73-win_amd64.whl (35.3 kB view hashes)

Uploaded PyPy Windows x86-64

incstatspy-0.3.1-pp38-pypy38_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (30.3 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

incstatspy-0.3.1-pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (33.8 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

incstatspy-0.3.1-pp38-pypy38_pp73-macosx_11_0_arm64.whl (29.6 kB view hashes)

Uploaded PyPy macOS 11.0+ ARM64

incstatspy-0.3.1-pp38-pypy38_pp73-macosx_10_9_x86_64.whl (30.5 kB view hashes)

Uploaded PyPy macOS 10.9+ x86-64

incstatspy-0.3.1-pp37-pypy37_pp73-win_amd64.whl (35.1 kB view hashes)

Uploaded PyPy Windows x86-64

incstatspy-0.3.1-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (30.0 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

incstatspy-0.3.1-pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (33.6 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

incstatspy-0.3.1-pp37-pypy37_pp73-macosx_10_9_x86_64.whl (30.2 kB view hashes)

Uploaded PyPy macOS 10.9+ x86-64

incstatspy-0.3.1-cp313-cp313-win_amd64.whl (35.4 kB view hashes)

Uploaded CPython 3.13 Windows x86-64

incstatspy-0.3.1-cp313-cp313-win32.whl (36.1 kB view hashes)

Uploaded CPython 3.13 Windows x86

incstatspy-0.3.1-cp313-cp313-musllinux_1_2_x86_64.whl (31.8 kB view hashes)

Uploaded CPython 3.13 musllinux: musl 1.2+ x86-64

incstatspy-0.3.1-cp313-cp313-musllinux_1_2_i686.whl (36.3 kB view hashes)

Uploaded CPython 3.13 musllinux: musl 1.2+ i686

incstatspy-0.3.1-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (30.4 kB view hashes)

Uploaded CPython 3.13 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

incstatspy-0.3.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (34.0 kB view hashes)

Uploaded CPython 3.13 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

incstatspy-0.3.1-cp313-cp313-macosx_11_0_arm64.whl (29.9 kB view hashes)

Uploaded CPython 3.13 macOS 11.0+ ARM64

incstatspy-0.3.1-cp313-cp313-macosx_10_13_x86_64.whl (30.4 kB view hashes)

Uploaded CPython 3.13 macOS 10.13+ x86-64

incstatspy-0.3.1-cp312-cp312-win_amd64.whl (35.4 kB view hashes)

Uploaded CPython 3.12 Windows x86-64

incstatspy-0.3.1-cp312-cp312-win32.whl (36.1 kB view hashes)

Uploaded CPython 3.12 Windows x86

incstatspy-0.3.1-cp312-cp312-musllinux_1_2_x86_64.whl (31.8 kB view hashes)

Uploaded CPython 3.12 musllinux: musl 1.2+ x86-64

incstatspy-0.3.1-cp312-cp312-musllinux_1_2_i686.whl (36.3 kB view hashes)

Uploaded CPython 3.12 musllinux: musl 1.2+ i686

incstatspy-0.3.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (30.4 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

incstatspy-0.3.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (34.0 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

incstatspy-0.3.1-cp312-cp312-macosx_11_0_arm64.whl (29.9 kB view hashes)

Uploaded CPython 3.12 macOS 11.0+ ARM64

incstatspy-0.3.1-cp312-cp312-macosx_10_9_x86_64.whl (30.7 kB view hashes)

Uploaded CPython 3.12 macOS 10.9+ x86-64

incstatspy-0.3.1-cp311-cp311-win_amd64.whl (35.3 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

incstatspy-0.3.1-cp311-cp311-win32.whl (36.2 kB view hashes)

Uploaded CPython 3.11 Windows x86

incstatspy-0.3.1-cp311-cp311-musllinux_1_2_x86_64.whl (31.7 kB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.2+ x86-64

incstatspy-0.3.1-cp311-cp311-musllinux_1_2_i686.whl (36.2 kB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.2+ i686

incstatspy-0.3.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (30.4 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

incstatspy-0.3.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (33.9 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

incstatspy-0.3.1-cp311-cp311-macosx_11_0_arm64.whl (29.8 kB view hashes)

Uploaded CPython 3.11 macOS 11.0+ ARM64

incstatspy-0.3.1-cp311-cp311-macosx_10_9_x86_64.whl (30.6 kB view hashes)

Uploaded CPython 3.11 macOS 10.9+ x86-64

incstatspy-0.3.1-cp310-cp310-win_amd64.whl (35.3 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

incstatspy-0.3.1-cp310-cp310-win32.whl (36.2 kB view hashes)

Uploaded CPython 3.10 Windows x86

incstatspy-0.3.1-cp310-cp310-musllinux_1_2_x86_64.whl (31.7 kB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.2+ x86-64

incstatspy-0.3.1-cp310-cp310-musllinux_1_2_i686.whl (36.2 kB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.2+ i686

incstatspy-0.3.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (30.4 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

incstatspy-0.3.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (33.9 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

incstatspy-0.3.1-cp310-cp310-macosx_11_0_arm64.whl (29.8 kB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

incstatspy-0.3.1-cp310-cp310-macosx_10_9_x86_64.whl (30.6 kB view hashes)

Uploaded CPython 3.10 macOS 10.9+ x86-64

incstatspy-0.3.1-cp39-cp39-win_amd64.whl (35.4 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

incstatspy-0.3.1-cp39-cp39-win32.whl (36.2 kB view hashes)

Uploaded CPython 3.9 Windows x86

incstatspy-0.3.1-cp39-cp39-musllinux_1_2_x86_64.whl (31.7 kB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.2+ x86-64

incstatspy-0.3.1-cp39-cp39-musllinux_1_2_i686.whl (36.2 kB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.2+ i686

incstatspy-0.3.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (30.4 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

incstatspy-0.3.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (33.9 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

incstatspy-0.3.1-cp39-cp39-macosx_11_0_arm64.whl (29.8 kB view hashes)

Uploaded CPython 3.9 macOS 11.0+ ARM64

incstatspy-0.3.1-cp39-cp39-macosx_10_9_x86_64.whl (30.6 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

incstatspy-0.3.1-cp38-cp38-win_amd64.whl (35.3 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

incstatspy-0.3.1-cp38-cp38-win32.whl (36.1 kB view hashes)

Uploaded CPython 3.8 Windows x86

incstatspy-0.3.1-cp38-cp38-musllinux_1_2_x86_64.whl (31.5 kB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.2+ x86-64

incstatspy-0.3.1-cp38-cp38-musllinux_1_2_i686.whl (36.0 kB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.2+ i686

incstatspy-0.3.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (30.3 kB view hashes)

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

incstatspy-0.3.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (33.8 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

incstatspy-0.3.1-cp38-cp38-macosx_11_0_arm64.whl (29.7 kB view hashes)

Uploaded CPython 3.8 macOS 11.0+ ARM64

incstatspy-0.3.1-cp38-cp38-macosx_10_9_x86_64.whl (30.5 kB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

incstatspy-0.3.1-cp37-cp37m-win_amd64.whl (34.9 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

incstatspy-0.3.1-cp37-cp37m-win32.whl (35.9 kB view hashes)

Uploaded CPython 3.7m Windows x86

incstatspy-0.3.1-cp37-cp37m-musllinux_1_2_x86_64.whl (31.2 kB view hashes)

Uploaded CPython 3.7m musllinux: musl 1.2+ x86-64

incstatspy-0.3.1-cp37-cp37m-musllinux_1_2_i686.whl (35.6 kB view hashes)

Uploaded CPython 3.7m musllinux: musl 1.2+ i686

incstatspy-0.3.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (29.8 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

incstatspy-0.3.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (32.9 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

incstatspy-0.3.1-cp37-cp37m-macosx_10_9_x86_64.whl (30.1 kB view hashes)

Uploaded CPython 3.7m macOS 10.9+ x86-64

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