numpy.square()

numpy.square

numpy.square(x[, out]) = <ufunc 'square'>

Return the element-wise square of the input.

Parameters:

x : array_like

Input data.

Returns:

out : ndarray

Element-wise x*x, of the same shape and dtype as x. Returns scalar if x is a scalar.

Examples

>>> np.square([-1j, 1])
array([-1.-0.j,  1.+0.j])

© 2008–2017 NumPy Developers
Licensed under the NumPy License.
https://docs.scipy.org/doc/numpy-1.12.0/reference/generated/numpy.square.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部