Movatterモバイル変換


[0]ホーム

URL:


SciPy

numpy.asfarray

numpy.asfarray(a,dtype=<class 'numpy.float64'>)[source]

Return an array converted to a float type.

Parameters:
a:array_like

The input array.

dtype:str or dtype object, optional

Float type code to coerce input arraya. Ifdtype is one of the‘int’ dtypes, it is replaced with float64.

Returns:
out:ndarray

The inputa as a float ndarray.

Examples

>>>np.asfarray([2,3])array([ 2.,  3.])>>>np.asfarray([2,3],dtype='float')array([ 2.,  3.])>>>np.asfarray([2,3],dtype='int8')array([ 2.,  3.])

Previous topic

numpy.squeeze

Next topic

numpy.asfortranarray

Quick search

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

[8]ページ先頭

©2009-2025 Movatter.jp