--- id: numpy-groupies version: "0.11.3" license: Copyright (c) 2016, numpy-groupies developers All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following… (full text in the JSON record) license_treatment: permissive maintenance: active --- # numpy-groupies — Optimised tools for group-indexing operations: aggregated sum and more. License: permissive · Maintenance: active · Downloads: 357.0K/mo ## What it is and what it does numpy-groupies provides a small library of optimized tools for group-indexing operations on arrays. The core function, `aggregate`, takes an array of values and an array of group labels, then computes a reduction (sum, mean, standard deviation, min, max, or custom function) for each group. It also supports cumulative operations like cumsum and cumprod that preserve the input size, and boolean aggregations like 'all' and 'any'. The package is conceptually similar to pandas groupby, MATLAB's accumarray, or the MapReduce paradigm. It handles various input shapes: 1D arrays with matching group indices, multidimensional arrays with axis-specific grouping, and 2D group index arrays for complex grouping patterns. The implementation is pure Python with numpy as an optional dependency, making it lightweight and easy to install. Use it for: - Compute statistics (sum, mean, variance) for data points belonging to labeled groups without loading a full dataframe library - Build histograms or frequency counts by aggregating values into bins defined by group indices - Perform cumulative operations within groups (e.g., running sum per group) while preserving input array size - Aggregate multidimensional scientific data along a specific axis by group membership - Handle NaN values selectively using nan-aware aggregation functions (nansum, nanmean, etc.) ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides optimized group-indexing operations on arrays, with `aggregate` as the primary tool for computing reductions (sum, mean, std, etc.) across labeled groups of values. Yes. Low install friction, no mandatory dependencies, active maintenance, permissive license, and a focused API for group aggregation operations. Install if you need group-based array reductions without the overhead of pandas or other dataframe libraries. The 449-day gap since last release is notable but not disqualifying given the active repository and stable API. ## Install pip install numpy-groupies uv add numpy-groupies poetry add numpy-groupies ## Installing numpy-groupies Before you install: Low friction: pure Python wheel with only numpy as an optional runtime dependency. Last release 449 days ago; repository active with recent commits and 210 stars. License in practice: BSD 2-Clause permissive license. No restrictions on commercial or private use; redistribution requires retaining copyright notice and disclaimer. Quickstart: pip install numpy_groupies import numpy as np import numpy_groupies as npg group_idx = np.array([3, 0, 0, 1, 0, 3, 5, 5, 0, 4]) a = np.array([13.2, 3.5, 3.5, -8.2, 3.0, 13.4, 99.2, -7.1, 0.0, 53.7]) result = npg.aggregate(group_idx, a, func='sum', fill_value=0) Verify before relying: - Whether all aggregation functions (sum, mean, std, min, max, etc.) are available in all backends or only in specific implementations - Performance characteristics and memory usage for large arrays or many groups - Whether the package is actively maintained or in maintenance-only mode given the 449-day gap since last release ## Package facts - License: Copyright (c) 2016, numpy-groupies developers All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following… (full text in the JSON record) (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 357.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags group aggregation numpy, accumarray python, groupby operations arrays, group indexing reduction, numpy aggregate by group, cumulative group operations, labeled array reduction, array-aggregation, group-operations, scientific-computing [View on SkillFed](https://skillfed.io/packages/numpy-groupies) · [View on PyPI](https://pypi.org/project/numpy-groupies/)