python机器学习指南 库和工具
numpy import numpy as np x = np.array([[1, 2, 3], [4, 5, 6]]) print(x:\n{}.format(x)) SciPy SciPy 是 Python 中用于科学计算的函数集合。最重要的是 scipy.sparse:它可以给出稀疏矩阵(sparse matrice) from scipy import sparse # 创建一个二维NumPy数组,对角线为1,其余都为0 eye = np.eye(4) print(NumPy array:\n{}.format(eye)) # 将NumPy数组转换为CSR格式的SciPy
下载地址
用户评论