本文簡要介紹 python 語言中 scipy.io.hb_write
的用法。
用法:
scipy.io.hb_write(path_or_open_file, m, hb_info=None)#
寫入HB-format 文件。
- path_or_open_file: path-like 或 file-like
如果是 file-like 對象,則按原樣使用。否則,它會在寫入之前打開。
- m: sparse-matrix
要寫的稀疏矩陣
- hb_info: HBInfo
包含 meta-data 用於寫入
- None
參數 ::
返回 ::
注意:
目前不支持完整的Harwell-Boeing 格式。支持的函數有:
assembled, non-symmetric, real matrices
integer for pointer/indices
exponential format for float values, and int format
例子:
我們可以讀寫harwell-boeing格式文件:
>>> from scipy.io import hb_read, hb_write >>> from scipy.sparse import csr_matrix, eye >>> data = csr_matrix(eye(3)) # create a sparse matrix >>> hb_write("data.hb", data) # write a hb file >>> print(hb_read("data.hb")) # read a hb file (0, 0) 1.0 (1, 1) 1.0 (2, 2) 1.0
相關用法
- Python SciPy io.hb_read用法及代碼示例
- Python SciPy io.whosmat用法及代碼示例
- Python SciPy io.savemat用法及代碼示例
- Python SciPy io.loadmat用法及代碼示例
- Python SciPy io.mminfo用法及代碼示例
- Python SciPy io.netcdf_file用法及代碼示例
- Python SciPy io.mmread用法及代碼示例
- Python SciPy io.FortranFile用法及代碼示例
- Python SciPy io.readsav用法及代碼示例
- Python SciPy io.mmwrite用法及代碼示例
- Python SciPy interpolate.make_interp_spline用法及代碼示例
- Python SciPy interpolate.krogh_interpolate用法及代碼示例
- Python SciPy interpolative.reconstruct_matrix_from_id用法及代碼示例
- Python SciPy interpolate.InterpolatedUnivariateSpline用法及代碼示例
- Python SciPy interpolate.BSpline用法及代碼示例
- Python SciPy integrate.quad_vec用法及代碼示例
- Python SciPy interpolative.reconstruct_interp_matrix用法及代碼示例
- Python SciPy interpolate.LSQSphereBivariateSpline用法及代碼示例
- Python SciPy interpolate.griddata用法及代碼示例
- Python SciPy integrate.cumulative_trapezoid用法及代碼示例
- Python SciPy interpolate.splder用法及代碼示例
- Python SciPy interpolate.LinearNDInterpolator用法及代碼示例
- Python SciPy interpolate.PPoly用法及代碼示例
- Python SciPy interpolate.NdBSpline用法及代碼示例
- Python SciPy interpolate.pade用法及代碼示例
注:本文由純淨天空篩選整理自scipy.org大神的英文原創作品 scipy.io.hb_write。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。