windows64 配置numpy,scipy及ipython notebook

Python各种模块下载地址http://www.lfd.uci.edu/~gohlke/pythonlibs/

将文件下载下来,在命令行进入下载的目录下,使用pip install xx.whl命令即可

ipython notebook的使用需要安装tornado模块和pyzmq

安装完后,命令行输入ipython notebook  --pylab inline 即可进入web

pyzmq:并发用的,是基于消息的网络模型的

markdown中是支持代码着色的

下面是使用ipython HTML notebook 的例子:(从python 数据分析上的)

In [23]:
points=np.arange(-5,5,0.01)
In [24]:
xs,ys=np.meshgrid(points,points)
In [25]:
xs
Out[25]:
array([[-5.  , -4.99, -4.98, ...,  4.97,  4.98,  4.99],
       [-5.  , -4.99, -4.98, ...,  4.97,  4.98,  4.99],
       [-5.  , -4.99, -4.98, ...,  4.97,  4.98,  4.99],
       ..., 
       [-5.  , -4.99, -4.98, ...,  4.97,  4.98,  4.99],
       [-5.  , -4.99, -4.98, ...,  4.97,  4.98,  4.99],
       [-5.  , -4.99, -4.98, ...,  4.97,  4.98,  4.99]])
In [26]:
ys
Out[26]:
array([[-5.  , -5.  , -5.  , ..., -5.  , -5.  , -5.  ],
       [-4.99, -4.99, -4.99, ..., -4.99, -4.99, -4.99],
       [-4.98, -4.98, -4.98, ..., -4.98, -4.98, -4.98],
       ..., 
       [ 4.97,  4.97,  4.97, ...,  4.97,  4.97,  4.97],
       [ 4.98,  4.98,  4.98, ...,  4.98,  4.98,  4.98],
       [ 4.99,  4.99,  4.99, ...,  4.99,  4.99,  4.99]])
In [27]:
import matplotlib.pyplot as plt
In [28]:
z=np.sqrt(xs**2+ys**2)
In [29]:
z
Out[29]:
array([[ 7.07106781,  7.06400028,  7.05693985, ...,  7.04988652,
         7.05693985,  7.06400028],
       [ 7.06400028,  7.05692568,  7.04985815, ...,  7.04279774,
         7.04985815,  7.05692568],
       [ 7.05693985,  7.04985815,  7.04278354, ...,  7.03571603,
         7.04278354,  7.04985815],
       ..., 
       [ 7.04988652,  7.04279774,  7.03571603, ...,  7.0286414 ,
         7.03571603,  7.04279774],
       [ 7.05693985,  7.04985815,  7.04278354, ...,  7.03571603,
         7.04278354,  7.04985815],
       [ 7.06400028,  7.05692568,  7.04985815, ...,  7.04279774,
         7.04985815,  7.05692568]])
In [30]:
plt.imshow(z,cmap=plt.cm.gray);plt.colorbar()
Out[30]:
<matplotlib.colorbar.Colorbar instance at 0x000000000A3C5948>
In [31]:
plt.title("image plot of $\sqrt{x^2+y^2}$ for a grid of values")
Out[31]:
<matplotlib.text.Text at 0xa5aca20>
不知道为什么没有图了


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值