Matrix operations for numpy and scipy
Project description
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
Release history Release notifications | RSS feed
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.8.tar.gz
(26.0 kB
view details)
Built Distribution
mopsy-0.2.8-py3-none-any.whl
(10.0 kB
view details)
File details
Details for the file mopsy-0.2.8.tar.gz
.
File metadata
- Download URL: mopsy-0.2.8.tar.gz
- Upload date:
- Size: 26.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 651c175c6ba84adb9e6a147bcc2184c204a4d8c79a66a28eedec98cf4f7c225b |
|
MD5 | 84edf8f30d27e2bdaf9219ebd1189092 |
|
BLAKE2b-256 | 7fe605a979e58981abe1f99c9dee87a6135875f0e98e866ec57f7cf82c221fe2 |
File details
Details for the file mopsy-0.2.8-py3-none-any.whl
.
File metadata
- Download URL: mopsy-0.2.8-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 34b91ec474dc484406769d1325e20e62ef7136638c54dd6a9ad985db10a9ce6d |
|
MD5 | 65da08d219a3e2bf1dae73b2111498cb |
|
BLAKE2b-256 | f844b0037aacc0eb078f79639484d2939c646c6273de8d105dd245a9d7951ace |