Skip to main content

Matrix operations for numpy and scipy

Project description

Project generated with PyScaffold PyPI-Server Unit tests

mopsy - Matrix Operations in Python

Convenience library to perform row/column operations over numpy and scipy matrices. Provides an interface similar to base R matrix methods/MatrixStats methods in python.

Installation

Install from pypi

pip install mopsy

Usage

from mopsy import colsum
import random from rd
# generate a random sparse array with some density
from scipy.sparse import random
mat = random(10, 150, 0.25)

# generate random groups
ngrps = 15
gsets = [x for x in range(15)]
groups = [rd.choice(gsets) for x in range(mat.shape[axis])]

colsum(mat, groups)

Methods are available to perform sum, median, mean along any axis. a generic apply method is also available for perform row-wise or column-wise operations.

Note

This project has been set up using PyScaffold 4.1.1. For details and usage information on PyScaffold see https://pyscaffold.org/.

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

mopsy-0.2.7.tar.gz (25.8 kB view hashes)

Uploaded Source

Built Distribution

mopsy-0.2.7-py3-none-any.whl (10.0 kB view hashes)

Uploaded Python 3

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