Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Vous êtes un professionnel et vous avez besoin d'une formation ? Deep Learning avec Python
et Keras et Tensorflow
Voir le programme détaillé
Module « scipy.io »

Fonction hb_read - module scipy.io

Signature de la fonction hb_read

def hb_read(path_or_open_file, *, spmatrix=True) 

Description

help(scipy.io.hb_read)

Read HB-format file.

Parameters
----------
path_or_open_file : path-like or file-like
    If a file-like object, it is used as-is. Otherwise, it is opened
    before reading.
spmatrix : bool, optional (default: True)
    If ``True``, return sparse ``coo_matrix``. Otherwise return ``coo_array``.

Returns
-------
data : csc_array or csc_matrix
    The data read from the HB file as a sparse array.

Notes
-----
At the moment not the full Harwell-Boeing format is supported. Supported
features are:

    - assembled, non-symmetric, real matrices
    - integer for pointer/indices
    - exponential format for float values, and int format

Examples
--------
We can read and write a harwell-boeing format file:

>>> from scipy.io import hb_read, hb_write
>>> from scipy.sparse import csr_array, eye
>>> data = csr_array(eye(3))  # create a sparse array
>>> hb_write("data.hb", data)  # write a hb file
>>> print(hb_read("data.hb", spmatrix=False))  # read a hb file
<Compressed Sparse Column sparse array of dtype 'float64'
    with 3 stored elements and shape (3, 3)>
    Coords  Values
    (0, 0)  1.0
    (1, 1)  1.0
    (2, 2)  1.0


Vous êtes un professionnel et vous avez besoin d'une formation ? Sensibilisation à
l'Intelligence Artificielle
Voir le programme détaillé