http://blog.csdn.net/pipisorry/article/details/39123171

Introduction to Scipy

SciPy函数库在NumPy库的基础上增加了众多的数学、科学以及工程计算中常用的库函数。例如线性代数、常微分方程数值求解、信号处理、图像处理、稀疏矩阵等等,涉及的领域众多。可以进行插值处理、信号滤波以及用C语言加速计算。

下载及安装参考[linux和windows下安装python拓展包及requirement.txt安装类库]

scipy API definition

Every submodule listed below is public. That means that these submodules are unlikely to be renamed or changed in an incompatible way, and if that is necessary a deprecation warning will be raised for one Scipy release before the change is made.

  • scipy.cluster

    • vq
    • hierarchy
  • scipy.constants
  • scipy.fftpack
  • scipy.integrate
  • scipy.interpolate
  • scipy.io
    • arff
    • harwell_boeing
    • idl
    • matlab
    • netcdf
    • wavfile
  • scipy.linalg
    • scipy.linalg.blas
    • scipy.linalg.lapack
    • scipy.linalg.interpolative
  • scipy.misc
  • scipy.ndimage
  • scipy.odr
  • scipy.optimize
  • scipy.signal
  • scipy.sparse
    • linalg
    • csgraph
  • scipy.spatial
    • distance
  • scipy.special
  • scipy.stats
    • distributions
    • mstats
  • scipy.weave

[API - importing from Scipy]

皮皮blog

Scipy中引入包的规则

'scipy' is actually a collection of subpackages.  The subpackages are not imported by executing 'import scipy'.  You'll have to explicitly import the scipy.spatial package with 'import scipy.spatial'.

其实主要是__init__.py中没有from . import subpackages,自己修改一下就好了,不过它本身没这么加肯定有它的原因,lz暂时还没搞清楚。

[scipy-ref-0.14.0-p933]

如果直接使用scipy调用会出现以下错误

...

scipy.misc.imsave(filename, numpy.kron(doc, zoom))

...

AttributeError: 'module' object has no attribute 'misc'

发生错误的原因

Most possibly because scipy is a library (package) that contains modules and to import a specific module from the scipy library, you need to specify it and import the module itself. As it's a separate module (sub-package), once you import it, it's attributes are available to you by using the regular scipy.module.attribute.

The modules inside scipy aren't accessible as attributes of the base scipy package.

对引入格式的说明

In Python the distinction between what is the public API of a library and what areprivate implementation details is not always clear. Unlike in other languages like Java, it is possible in Python to access “private” function or objects. Occasionally this may be convenient, but be aware that if you do so your code may break without warning in future releases.

Some widely understood rules for what is and isn’t public in Python are:

  • Methods / functions / classes and module attributes whose names begin with a leading underscore are private.
  • If a class name begins with a leading underscore none of its members are public, whether or not they begin with a leading underscore.
  • If a module name in a package begins with a leading underscore none of its members are public, whether or not they begin with a leading underscore.
  • If a module or package defines __all__ that authoritatively defines the public interface.
  • If a module or package doesn’t define __all__ then all names that don’t start with a leading underscore are public.

Note:Reading the above guidelines one could draw the conclusion that every private module or object starts with an underscore. This is not the case; the presence of underscores do mark something as private, but the absence of underscores do not mark something as public.

In Scipy there are modules whose names don’t start with an underscore, but that should be considered private. To clarify which modules these are we define below what the public API is for Scipy, and give some recommendations for how to import modules/functions/objects from Scipy.

解决

1. You might need to install PIL or Pillow.
PIL is required by imsave (and other im* functions in scipy.misc).  【http://stackoverflow.com/questions/9298665/cannot-import-scipy-misc-imread】

2. You need to do import scipy.misc or from scipy import misc.

[python模块导入及属性:import ]

Guidelines for importing functions from Scipy 从scipy中引入包

The scipy namespace itself only contains functions imported from numpy. These functions still exist for backwards compatibility, but should be imported from numpy directly.

Everything in the namespaces of scipy submodules is public. In general, it is recommended to import functions from submodule namespaces.

For example, the function curve_fit (defined in scipy/optimize/minpack.py) should be imported like this:

from scipy import optimize
result = optimize.curve_fit(...)

In some cases, the public API is one level deeper.

For example the scipy.sparse.linalg module is public, and the functions it contains are not available in thescipy.sparse namespace. Sometimes it may result in more easily understandable code if functions are imported from one level deeper.

For example, in the following it is immediately clear thatlomax is a distribution if the second form is chosen:

# first form
from scipy import stats
stats.lomax(...)# second form
from scipy.stats import distributions
distributions.lomax(...)

In that case the second form can be chosen, if it is documented in the next section that the submodule in question is public.

皮皮blog

Scipy:高端科学计算

[http://reverland.org/python/2012/10/22/scipy/#scipyio]

from: http://blog.csdn.net/pipisorry/article/details/39123171

ref:scipy API及英文教程: http://docs.scipy.org/doc/scipy/reference/

Scipy教程 - python数值计算库相关推荐

  1. Python 数值计算库scipy 统计模块stats用法入门

    文章目录 statis模块概述 连续概率分布 正态分布(norm) 概率检验/假设检验(Statistical tests) K-S检验(Kolmogorov-Smirnov test ) scipy ...

  2. Python 数值计算库之-[Pandas](六)

    转载于:https://www.cnblogs.com/jiyimeng/p/python11147.html

  3. python的科学计算库有哪些_《用Python进行科学计算》——SciPy数值计算库

    SciPy函数库在NumPy库的基础上增加了众多的数学.科学以及工程计算中常用的库函数.例如线性代数.常微分方程数值求解.信号处理.图像处理.稀疏矩阵等. 最小二乘拟合 假设有一组实验数据(x[i], ...

  4. 《用Python进行科学计算》——SciPy数值计算库

    SciPy函数库在NumPy库的基础上增加了众多的数学.科学以及工程计算中常用的库函数.例如线性代数.常微分方程数值求解.信号处理.图像处理.稀疏矩阵等. 最小二乘拟合 假设有一组实验数据(x[i], ...

  5. python安装第三方库win10_音频处理 windows10下python三方库librosa安装教程

    librosa是处理音频库里的opencv,使用python脚本研究音频,先安装三方库librosa. 如下通过清华镜像源安装librosa: pip install -i https://pypi. ...

  6. python科学计算库-数值计算库与科学计算库

    BLAS 接口 BLAS , LAPACK , ATLAS 这些数值计算库的名字很类似,他们之间有什么关系呢?BLAS是一组线性代数运算接口,目前是事实上的标准,很多数值计算/科学计算都实现了这套接口 ...

  7. python安装第三方库re_音频处理 windows10下python三方库librosa安装教程

    librosa是处理音频库里的opencv,使用python脚本研究音频,先安装三方库librosa. 如下通过清华镜像源安装librosa: pip install -i https://pypi. ...

  8. python统计函数库scipy.stats的用法1/3

    背景 总结统计工作中几个常用用法在python统计函数库scipy.stats的使用范例. 正态分布 以正态分布的常见需求为例了解scipy.stats的基本使用方法. 生成服从指定分布的随机数 no ...

  9. Python培训教程分享:“高效实用” 的Python工具库

    作为一名合格Python技术员,对于Python工具库的使用是少不了的,本期Python培训教程就为大家分享的是""高效实用" 的Python工具库",希望能够 ...

  10. [python教程入门学习]Python标准库映射类型与可散列数据类型的关系

    本文章向大家介绍Python标准库映射类型与可散列数据类型的关系,主要包括Python标准库映射类型与可散列数据类型的关系使用实例.应用技巧.基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋 ...

最新文章

  1. C 语言实例 - 计算自然数的和
  2. Audio-based snore detection using deep neural networks解读
  3. c++ vs2015 播放音乐_Linux 中的十大开源视频播放器
  4. 【BZOJ1058】[ZJOI2007]报表统计 STL
  5. 用ssl.ca自制证书
  6. nginx 使用自定义 log_format 以及输出自定义http头
  7. mysql 不等于查询优化_MySQL查询性能优化
  8. 进博会中国自行车排名辐轮王自行车点赞中国GDP突破一百万亿元
  9. leetcode:买卖股票最佳时机含手续费
  10. 要提高微信群人气,活跃用户,如何在微信群设置签到打卡?
  11. 计算机芯片维修论文,中职院校计算机硬件芯片检测及维修的论文
  12. [C#]C# 如何捕获键盘按钮和组合键以及KeyPress/KeyDown事件之间的区别 (附KeyChar/KeyCode值)
  13. abs绝对位置指令 三菱plc_三菱FX系列PLC方便指令的使用方法
  14. java计算机毕业设计-数字相册管理系统-源码+数据库+系统+lw文档+mybatis+运行部署
  15. 机器学习分类器——案例(opencv sklearn svm ann)
  16. 二零一九第二天 文/一个会写诗的程序员
  17. 论文阅读(3) 用气泡PIV测量加利福尼亚海狮推进冲程的速度场(2022)
  18. 简易爬取巨潮网年度审计报告
  19. 网络错误 请确保您已连接到网络并重试
  20. Java:任务描述:手机通讯录的实现

热门文章

  1. wampserver下修改mysql root用户的登录密码
  2. 杭电 看归并排序和快速排序
  3. [bzoj3809]Gty的二逼妹子序列/[bzoj3236][Ahoi2013]作业
  4. P4692 [Ynoi2016]谁的梦
  5. fastjson使用-- @JSONField使用(转)
  6. 断路器之一:Hystrix 使用与分析
  7. Openbox 3.3
  8. 查看Android设备的分辨率
  9. CUDA 和 GPU
  10. 【整理】牛客网编程题-前端篇(入门难度)