安装NumPy函数库——sudo apt-get install python-numpy

以及  sudo apt-get install python-scipy

NumPy函数库的函数查看:NumPy函数

from numpy import *
random.rand(4,4)
array([[ 0.00346766, 0.31435508, 0.62660357, 0.66226196],
[ 0.50846942, 0.36985927, 0.97623186, 0.16018687],
[ 0.73907921, 0.47685173, 0.53514874, 0.25197389],
[ 0.89880414, 0.07204696, 0.79321122, 0.59009984]])

NumPy函数库中存在两种不同的数据类型(矩阵matrix和数组array),都可以用于处理行列表示的数字元素。

使用mat()函数可以将数组转化为矩阵,.I操作符实现了矩阵求逆的运算。

>>> randMat = mat(random.rand(4,4))
>>> randMat.I
matrix([[-2.23277822, 0.56864719, 0.72165341, 1.67388598],
[ 1.11436389, -1.14057081, -0.0595431 , 0.01907366],
[ 0.03110561, 1.15558961, -0.87337803, 0.73494119],
[ 0.84605656, 0.16058555, 1.10866379, -1.95587311]])

安装matplotlib——sudo apt-get install python-matplotlib

ubuntu下安装numpy和matplotlib的更多相关文章

  1. Ubuntu下安装Numpy, SciPy and Matplotlib

    Python开发环境包含科学计算,需要安装NumPy, SciPy, Matplotlib.其中Matplotlib依赖于Python和NumPy.我们先安装NumPY和SciPy.  Matplot ...

  2. Windows10+Python3下安装NumPy+SciPy+Matplotlib

    Numpy.SciPy.MatplotLib是Python下从事科学计算必不可少的库.我在用其他的方法安装时出现各种问题,发现直接安装.whl包是最快且不报错的方法. 1.下载.whl包在下面的网站中 ...

  3. Ubuntu下安装python相关数据处理

    01. Ubuntu下安装ipython sudo apt-get install ipython 02. Ubuntu下安装pip $ sudo apt-get install python-pip ...

  4. win7系统下python安装numpy,matplotlib,scipy和scikit-learn

    1.安装numpy,matplotlib,scipy和scikit-learn win7系统下直接采用pip或者下载源文件进行安装numpy,matplotlib,scipy时会遇到各种问题,这是因为 ...

  5. Python离线断网情况下安装numpy、pandas和matplotlib等常用第三方包

    联网情况下在命令终端CMD中输入“pip install numpy”即可自动安装,pandas和matplotlib同理一样方法进行自动安装. 工作的电脑不能上外网,所以不能通过直接输入pip命令来 ...

  6. Windows系统在Python2.7环境下安装numpy, matplotlib, scipy - Lichanghao Blog

    numpy, matplotlib, scipy三个包是科学计算和绘图的利器.安装它们既可以在网上下载exe安装包,也可以用python内置的包管理工具来下载安装,后者较为方便. 这几天做美赛要用到, ...

  7. 安装Numpy和matplotlib

    (1)测试程序     这是我从网上(http://www.open-open.com/lib/view/open1393488232380.html)找到的一个使用Numpy和matplotlib的 ...

  8. ubuntu下安装pandas出现 compile failed with error code 1 in /tmp/pip_build_hadoop/pandas

    都是用pip装的,是不是应该用apt-get 装的呀 ubuntu下安装pandas (出现 compile failed with error code 1 in /tmp/pip_build_ha ...

  9. 《机器学习实战-KNN》—如何在cmd命令提示符下运行numpy和matplotlib

    问题背景:好吧,文章标题是瞎取得.平常用cmd运行python代码问题不大,我在学习<机器学习实战>这本书时,发现cmd无法运行import numpy as np以及import mat ...

随机推荐

  1. Undefined class constant 'MYSQL_ATTR_INIT_COMMAND'

    新下载的php3.23,本地访问数据库可以,服务器上不行.如下: :( Undefined class constant 'MYSQL_ATTR_INIT_COMMAND' 错误位置 FILE: /u ...

  2. html之长文本框置顶

    方法: 在<body> </body>中添加如下代码: <a name="top"></a> <a href="#t ...

  3. 【推荐】CentOS安装vsftpd-3.0.2+安全配置

    注:以下所有操作均在CentOS 6.5 x86_64位系统下完成. FTP的登录一般有三种方式,分别是: 匿名用户形式:默认安装的情况下,系统只提供匿名用户访问,只需要输入用户anonymous/f ...

  4. Neutron 理解(5):Neutron 是如何向 Nova 虚机分配固定IP地址的 (How Neutron Allocates Fixed IPs to Nova Instance)

    学习 Neutron 系列文章: (1)Neutron 所实现的虚拟化网络 (2)Neutron OpenvSwitch + VLAN 虚拟网络 (3)Neutron OpenvSwitch + GR ...

  5. 配置安装ecplise跑项目

    jdk配置:http://jingyan.baidu.com/article/6dad5075d1dc40a123e36ea3.html系统变量→新建 JAVA_HOME 变量 .变量值填写jdk的安 ...

  6. [tem]Longest Increasing Subsequence(LIS)

    Longest Increasing Subsequence(LIS) 一个美丽的名字 非常经典的线性结构dp [朴素]:O(n^2) d(i)=max{0,d(j) :j<i&& ...

  7. linux下更新python

    刚开始入门python,想直接入门python3,需要更新一下linux自带的python.自带的python是2.6,可以在终端root下键入python查看python版本. 1.从官网下载pyt ...

  8. C++学习笔记(2)

    本学习笔记是C++ primer plus(第六版)学习笔记.是C++学习笔记(1)的后续.复习C++基础知识的可以瞄瞄. 转载请注明出处http://www.cnblogs.com/zrtqsk/p ...

  9. Swift学习(三):闭包(Closures)

    定义 闭包(Closures)是独立的函数代码块,能在代码中传递及使用. 语法 {(parameters) -> return type in statements } 注:闭包表达式语法可以使 ...

  10. DNS简析

    IntroductionName Server架构分层管理机制分层查询机制Name Server之间的Master-Slave架构DDNS底层协议配置文件/etc/hosts/etc/resov.co ...