This package contains a Python implementation of a cursor for NumPy matrices. The cursor allows you to conveniently move through a matrix and read or modify its values.
Project description
NumPy Cursor
This repository contains a Python implementation of a cursor for NumPy matrices. The cursor allows you to conveniently move through a matrix and read or modify its values.
The cursor class has the following methods:
__init__(self, matrix): Initializes the cursor with a NumPy matrix.left(self, steps=1): Moves the cursor left bystepscolumns.right(self, steps=1): Moves the cursor right bystepscolumns.up(self, steps=1): Moves the cursor up bystepsrows.down(self, steps=1): Moves the cursor down bystepsrows.move(self, row_steps, col_steps): Moves the cursor byrow_stepsrows andcol_stepscolumns.set(self, row, col): Set the cursor byrowrows andcolcolumns.coordinates: Returns the current row and column coordinates of the cursor.isEmpty: ReturnsTrueif the value of the matrix at the current cursor position is zero, andFalseotherwise.setItem(self, item): Setting the value of the cursor cell byitem.__repr__(self): Returns a string representation of the value of the matrix at the current cursor position.__str__(self): Returns a string representation of the value of the matrix at the current cursor position.
The implementation also includes error checking to prevent moving the cursor beyond the boundaries of the matrix.
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 numpy_cursor-1.0.5.tar.gz.
File metadata
- Download URL: numpy_cursor-1.0.5.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4bbb70f95bf042bab631edd2e6b8545eb6a9aea0840e9bfcf49c14383100cdcc
|
|
| MD5 |
8efafed767b13e01be50cd6c15809d5b
|
|
| BLAKE2b-256 |
b59c7cd73d22f17795d125d639f759f9664884079d82e2fa2f785e75781a9f39
|
File details
Details for the file numpy_cursor-1.0.5-py3-none-any.whl.
File metadata
- Download URL: numpy_cursor-1.0.5-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb6b0a87993d05646f64af9374cefe513571879d5c70522b0e0900c745f95035
|
|
| MD5 |
3b756045f1e6f443975803dc5ccf7f37
|
|
| BLAKE2b-256 |
17a77822a8b3d1815ff4a0853f36d9ac2e3f001f9b119bba7917ac998cd82210
|