0

I am completely new to python and trying to debug a code which needs to be re-written in C. This might be a very silly question. I came across this statement

result[i, j] = arr[i:j+1].var() * (j-i)

I just couldn't find the documentation of this var() method even after googling out. Can some one tell me what exactly does it mean?

4

1 回答 1

1

这是一个疯狂的猜测,但如果那是Numpyndarray

ndarray.var([axis, dtype, out, ddof]) 返回数组元素沿给定轴的方差。

你会创建一个类似的ndarray东西:

import numpy

a = numpy.array([1, 2, 3, 4])

然后a.var()会给你方差。

于 2012-09-11T21:20:45.940 回答