3段极简代码带你入门Python科学计算库SciPy
导读:SciPy是基于NumPy的,提供了更多的科学计算功能,比如线性代数、优化、积分、插值、信号处理等。
from scipy import io as spio
import numpy as np
a=np.arange(10)
spio.savemat('a.mat',{'a':a})
data = spio.loadmat('a.mat', struct_as_record=True)
data['a']
array([[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]])
from scipy import linalg
m=np.array([[1,2],[3,4]])
linalg.det(m)
-2.0
import numpy as np
from scipy import optimize
import matplotlib.pyplot as plt
deff(x):
return x**2+20*np.sin(x)
x=np.arange(-10,10,0.1)
plt.plot(x,f(x))
grid=(-10,10,0.1)
x_min=optimize.brute(f,(grid,))
x_min
Out:
array([-1.42754883])
点击上图了解及购买
划重点👇
在公众号对话框输入以下关键词
查看更多优质内容!
据统计,99%的大咖都关注了这个公众号
👇
阅读原文 最新评论
推荐文章
作者最新文章
你可能感兴趣的文章
Copyright Disclaimer: The copyright of contents (including texts, images, videos and audios) posted above belong to the User who shared or the third-party website which the User shared from. If you found your copyright have been infringed, please send a DMCA takedown notice to [email protected]. For more detail of the source, please click on the button "Read Original Post" below. For other communications, please send to [email protected].
版权声明:以上内容为用户推荐收藏至CareerEngine平台,其内容(含文字、图片、视频、音频等)及知识版权均属用户或用户转发自的第三方网站,如涉嫌侵权,请通知[email protected]进行信息删除。如需查看信息来源,请点击“查看原文”。如需洽谈其它事宜,请联系[email protected]。
版权声明:以上内容为用户推荐收藏至CareerEngine平台,其内容(含文字、图片、视频、音频等)及知识版权均属用户或用户转发自的第三方网站,如涉嫌侵权,请通知[email protected]进行信息删除。如需查看信息来源,请点击“查看原文”。如需洽谈其它事宜,请联系[email protected]。