Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/biocpy/mopsy
Matrix operations
https://github.com/biocpy/mopsy
matrix numpy scipy
Last synced: 8 days ago
JSON representation
Matrix operations
- Host: GitHub
- URL: https://github.com/biocpy/mopsy
- Owner: BiocPy
- License: mit
- Created: 2022-04-02T15:53:32.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-11-11T16:29:54.000Z (8 days ago)
- Last Synced: 2024-11-11T17:31:09.335Z (8 days ago)
- Topics: matrix, numpy, scipy
- Language: Python
- Homepage: https://biocpy.github.io/mopsy/
- Size: 3.08 MB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.rst
- License: LICENSE.txt
- Authors: AUTHORS.md
Awesome Lists containing this project
README
[![Project generated with PyScaffold](https://img.shields.io/badge/-PyScaffold-005CA0?logo=pyscaffold)](https://pyscaffold.org/)
[![PyPI-Server](https://img.shields.io/pypi/v/mopsy.svg)](https://pypi.org/project/mopsy/)
![Unit tests](https://github.com/BiocPy/mopsy/actions/workflows/pypi-test.yml/badge.svg)# 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](https://pypi.org/project/mopsy/)
```shell
pip install mopsy
```## Usage
```python
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/.