Introduction to other applications of numpy

a code

  1. import numpy as np
  2. from numpy.linalg import*
  3. print("FFT:")
  4. print(np.fft.fft(np.array([1,1,1,1,1,1,1,1])))
  5. #相关系数
  6. print("Coef:")
  7. print(np.corrcoef([1,0,1],[0,2,1]))
  8. #一元多次函数
  9. print(np.poly1d([2,1,3]))
Second run results
FFT:
[ 8.+0.d 0.+0.d 0.+0.d 0.+0.d 0.+0.d 0.+0.d 0.+0.d 0.+0.d]
Coef:
[[ 1.        -0.8660254]
 [-0.8660254  1.       ]]
   2
2 x + 1 x + 3

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327040336&siteId=291194637