numpy+scipy+matplotlib

  • NumPy是Python語言的一個擴充程式庫。支援高階大量的維度陣列與矩陣運算
  • SciPy是Python演算法庫和數學工具包
  • Matplotlib是MATLAB內建繪圖功能類似的函數庫

numpy

  • np.array()
  • np.linspace()
  • np.arange(6)
  • np.reshape((3, 2))
  • numpy.random
  • numpy.linalg

scipy

  • Special functions (scipy.special)
  • Integration (scipy.integrate)
  • Optimization (scipy.optimize)
  • Interpolation (scipy.interpolate)
  • Fourier Transforms (scipy.fftpack)
  • Signal Processing (scipy.signal)
  • Linear Algebra (scipy.linalg)
  • Sparse Eigenvalue Problems with ARPACK
  • Compressed Sparse Graph Routines (scipy.sparse.csgraph)
  • Spatial data structures and algorithms (scipy.spatial)
  • Statistics (scipy.stats)
  • Multidimensional image processing (scipy.ndimage)
  • File IO (scipy.io)

matplotlib

  • plt.plot() / plt.subplot()
  • plt.scatter()
  • plt.show()
  • plt.imshow()
  • plt.hist()

2d array

import numpy as np
a = np.array([[1, 2, 3], [3, 4, 6.7], [5, 9.0, 5]])

Scatter plot

import matplotlib.pyplot as plt
from numpy.random import rand
a = rand(100)
b = rand(100)
plt.scatter(a, b)
plt.show()

results matching ""

    No results matching ""