Skip to main content

Package for creation of sparse matrices (SSparseMatrix objects.)

Project description

Random Sparse Matrix Generator in Python

In brief

This Python package implements the function random_sparse_matrix that generates random sparse matrices.


Installation

To install from GitHub use the shell command:

python -m pip install git+https://github.com/antononcube/Python-packages.git#egg=RandomSparseMatrix\&subdirectory=RandomSparseMatrix

To install from PyPI:

python -m pip install RandomSparseMatrix

Examples

Here is random sparse matrix (SSparseMatrix object) with 6 rows and 4 columns:

import random
from RandomSparseMatrix import *

random.seed(87)
rmat = random_sparse_matrix(6, 4,
                            column_names_generator=random_pet_name,
                            row_names_generator=random_word,
                            min_number_of_values=6,
                            max_number_of_values=None)
rmat.print_matrix(n_digits=20)

# ============================================================================================
#            |                Cleo             Diamond                 Max               Tessa
# --------------------------------------------------------------------------------------------
#  cuticular |                   .                   .                   .  12.886794438387263
#    elysian |                   .                   .                   .  13.891135469455826
# spot-check |                   .  11.465064963144142                   .                   .
#   cetacean |                   .   9.626463367706222                   .                   .
#       idem |   5.474873249244756                   .                   .                   .
#        lot |                   .                   .  10.818678723268317                   .
# ============================================================================================

References

[AAp1] Anton Antonov, SSparseMatrix Python package, (2021), PyPI.

[AAp2] Anton Antonov, RandomDataGenerators Python package, (2021), PyPI.

[AAp3] Anton Antonov, SparseMatrixRecommender Python package, (2021), PyPI.

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

RandomSparseMatrix-0.1.0.tar.gz (4.5 kB view hashes)

Uploaded Source

Built Distribution

RandomSparseMatrix-0.1.0-py3-none-any.whl (4.8 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