我可以对numpy数组执行大量统计,但"median"会返回属性错误.当我做"dir(np)"时,我确实看到列出的中位数方法.
(newpy2) 7831c1c083a2:src scaldara$ python
Python 2.7.12 |Continuum Analytics, Inc.| (default, Jul 2 2016, 17:43:17)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
>>> import numpy as np
>>> print(np.version.version)
1.11.2
>>> a = np.array([1,2,3,4,5,6,7,8,9,10])
>>> print(a)
[ 1 2 3 4 5 6 7 8 9 10]
>>> print(a.min())
1
>>> …Run Code Online (Sandbox Code Playgroud)