Python34安装NumPy

[size=large]numpy 准确地说提供了一个在python中做科学计算的基础库,侠义地讲它重在数值计算,甚至可以说是用于多维数组处理的库;而 scipy 则是基于numpy,提供了一个在python中做科学计算的工具集,也就是说它是更上一个层次的库。
下面只介绍numpy的安装方法(scipy一样)[/size]

[size=large][color=red] 1、下载对应版本NumPy(我用的python3.4下载对应numpy-1.9.2+unoptimized-cp34-none-win32.whl) [/color][/size]

http://sourceforge.net/projects/numpy/files/NumPy/

[size=x-large][color=brown]python3.4 Delbert默认版本为3.4,第二步不用执行。2.7的就得安装wheel[/color][/size]

[size=large][color=red] 2、由于下载下来的包是wheel格式的,需要wheel支持。所以需要先通过cd命令切换到python安装路径下的Script文件夹,输入 pip install wheel 来安装wheel。[/color][/size]

C:\Python34\Scripts>pip install wheel
You are using pip version 6.0.8, however version 7.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command. Collecting wheel
Downloading wheel-0.24.0-py2.py3-none-any.whl (63kB)
100% |################################| 65kB 113kB/s
Installing collected packages: wheel

Successfully installed wheel-0.24.0

[size=large][color=red]3、 pip install 来进行安装 [/color][/size]

C:\Python34\Scripts>pip install C:\Python34\numpy-1.9.2+unoptimized-cp34-none-w in32.whl
You are using pip version 6.0.8, however version 7.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command. Processing c:\python34\numpy-1.9.2+unoptimized-cp34-none-win32.whl
Installing collected packages: numpy Successfully installed numpy-1.9.2

[size=large][color=red]4、进入python运行环境(cmd)[/color][/size]


C:\Python34\Scripts>C:\Python34\python.exe
Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:43:06) [MSC v.1600 32 bit (In
tel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

[size=large][color=red]在python下导入numpy[/color][/size]
>>>; from numpy import *

[size=large][color=red]安装完成,可以测试了。[/color][/size]
4*4的随机数组:

>>> random.rand(4,4)
array([[ 0.90056883, 0.10542202, 0.02104658, 0.45606525],
[ 0.37256702, 0.38938058, 0.81695404, 0.3021916 ],
[ 0.02081778, 0.65920287, 0.18204678, 0.70915739],
[ 0.74607969, 0.9682355 , 0.49196832, 0.74588514]])
>>>
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值