Movatterモバイル変換


[0]ホーム

URL:


SciPy

numpy.real

numpy.real(val)[source]

Return the real part of the complex argument.

Parameters:
val:array_like

Input array.

Returns:
out:ndarray or scalar

The real component of the complex argument. Ifval is real, the typeofval is used for the output. Ifval has complex elements, thereturned type is float.

Examples

>>>a=np.array([1+2j,3+4j,5+6j])>>>a.realarray([ 1.,  3.,  5.])>>>a.real=9>>>aarray([ 9.+2.j,  9.+4.j,  9.+6.j])>>>a.real=np.array([9,8,7])>>>aarray([ 9.+2.j,  8.+4.j,  7.+6.j])>>>np.real(1+1j)1.0

Previous topic

numpy.angle

Next topic

numpy.imag

Quick search

  • © Copyright 2008-2018, The SciPy community.
  • Last updated on Jul 24, 2018.
  • Created usingSphinx 1.6.6.

[8]ページ先頭

©2009-2025 Movatter.jp