假设你有n个方矩阵A1,...,An.无论如何要以整齐的方式将这些矩阵相乘吗?据我所知,numpy中的dot只接受两个参数.一种显而易见的方法是定义一个函数来调用自身并获得结果.有没有更好的方法来完成它?
无论如何在Mac OS Lion附带的python 2.6.7上安装numpy和scipy?我知道Lion也有Python 2.7.但我需要坚持使用Python 2.6,因为我使用的模块在Python 2.7上不起作用.
我正在尝试在Lion OS附带的预装Python 2.6上安装numpy和scipy.
以下是我正在采取的具体步骤:
Downloading/unpacking numpy from http://pypi.python.org/packages/source/n/numpy/numpy- 1.6.2.zip#md5=7e13c931985f90efcfa0408f845d6fee
Downloading numpy-1.6.2.zip (2.9Mb): 2.9Mb downloaded
Running setup.py egg_info for package numpy
Running from numpy source directory.non-existing path in 'numpy/distutils': 'site.cfg'
F2PY Version 2
blas_opt_info:
FOUND:
extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
define_macros = [('NO_ATLAS_INFO', 3)]
extra_compile_args = ['-msse3', '- I/System/Library/Frameworks/vecLib.framework/Headers']
lapack_opt_info:
FOUND:
extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
define_macros = [('NO_ATLAS_INFO', 3)]
extra_compile_args = ['-msse3']
build_src
building py_modules sources
building library "npymath" sources
customize NAGFCompiler …Run Code Online (Sandbox Code Playgroud)