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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mopsy-0.3.0.tar.gz.
File metadata
- Download URL: mopsy-0.3.0.tar.gz
- Upload date:
- Size: 26.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.9.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52a771e9df70ce23ca6a3a1eb8d986f20de524698ea1ce12f17f53ffd30a9b7f
|
|
| MD5 |
254c849f2ff81955374c7d5b50e88177
|
|
| BLAKE2b-256 |
7c70860ec8cd858844efa52fa12f205744c8d47e3d19b9112c423a76b8a09147
|
File details
Details for the file mopsy-0.3.0-py3-none-any.whl.
File metadata
- Download URL: mopsy-0.3.0-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.9.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1277476dc8b8d5ec57dc55015570b1b167ee4a1f649dd4ddc5d0b25096d4fa68
|
|
| MD5 |
92511ca54699ba3cea8e8a616a6c6efc
|
|
| BLAKE2b-256 |
2566888619634977c42f557d55f1c22029f28468a111b0eddb145628f765fd9e
|