Single-precision floating-point number type, compatible with C float.
Inherits From: inexact
tf.experimental.numpy.float32(
*args, **kwargs
)
:Character code: 'f'
:Canonical name: numpy.single
:Alias on this platform (Linux x86_64): numpy.float32: 32-bit-precision floating-point number type: sign bit, 8 bits exponent, 23 bits mantissa.
Methods
all
all(
axis=None, out=None, keepdims=False, *, where=True
)
Scalar method identical to ndarray.all.
any
any(
axis=None, out=None, keepdims=False, *, where=True
)
Scalar method identical to ndarray.any.
argmax
argmax(
axis=None, out=None, *, keepdims=False
)
Scalar method identical to ndarray.argmax.
argmin
argmin(
axis=None, out=None, *, keepdims=False
)
Scalar method identical to ndarray.argmin.
argsort
argsort(
axis=-1, kind=None, order=None, *, stable=None
)
Scalar method identical to ndarray.argsort.
as_integer_ratio
as_integer_ratio()
single.as_integer_ratio() -> (int, int)
Return a pair of integers, whose ratio is exactly equal to the original
floating point number, and with a positive denominator.
Raise OverflowError on infinities and a ValueError on NaNs.
np.single(10.0).as_integer_ratio()(10, 1)np.single(0.0).as_integer_ratio()(0, 1)np.single(-.25).as_integer_ratio()(-1, 4)
astype
astype(
dtype,
order='K',
casting='unsafe',
subok=True,
copy=True
)
Scalar method identical to ndarray.astype.
byteswap
byteswap(
inplace=False
)
Scalar method identical to ndarray.byteswap.
choose
choose(
choices, out=None, mode='raise'
)
Scalar method identical to ndarray.choose.
clip
clip(
min=None, max=None, out=None, **kwargs
)
Scalar method identical to ndarray.clip.
compress
compress(
condition, axis=None, out=None
)
Scalar method identical to ndarray.compress.
conj
conj()
Scalar method identical to ndarray.conj.
conjugate
conjugate()
Scalar method identical to ndarray.conjugate.
copy
copy(
order='C'
)
Scalar method identical to ndarray.copy.
cumprod
cumprod(
axis=None, dtype=None, out=None
)
Scalar method identical to ndarray.cumprod.
cumsum
cumsum(
axis=None, dtype=None, out=None
)
Scalar method identical to ndarray.cumsum.
diagonal
diagonal(
offset=0, axis1=0, axis2=1
)
Scalar method identical to ndarray.diagonal.
dump
dump(
file
)
Scalar method identical to ndarray.dump.
dumps
dumps()
Scalar method identical to ndarray.dumps.
fill
fill(
value
)
Scalar method identical to ndarray.fill.
flatten
flatten(
order='C'
)
Scalar method identical to ndarray.flatten.
getfield
getfield(
dtype, offset=0
)
Scalar method identical to ndarray.getfield.
is_integer
is_integer()
single.is_integer() -> bool
Return True if the floating point number is finite with integral
value, and False otherwise.
.. versionadded:: 1.22
Examples
>>> np.single(-2.0).is_integer()
True
>>> np.single(3.2).is_integer()
False
item
item(
*args
)
Scalar method identical to ndarray.item.
max
max(
axis=None, out=None, **kwargs
)
Scalar method identical to ndarray.max.
mean
mean(
axis=None, dtype=None, out=None, **kwargs
)
Scalar method identical to ndarray.mean.
min
min(
axis=None, out=None, **kwargs
)
Scalar method identical to ndarray.min.
nonzero
nonzero()
Scalar method identical to ndarray.nonzero.
prod
prod(
axis=None, dtype=None, out=None, **kwargs
)
Scalar method identical to ndarray.prod.
put
put(
indices, values, /, mode='raise'
)
Scalar method identical to ndarray.put.
ravel
ravel(
order='C'
)
Scalar method identical to ndarray.ravel.
repeat
repeat(
repeats, /, axis=None
)
Scalar method identical to ndarray.repeat.
reshape
reshape(
*shape, order='C', copy=None
)
Scalar method identical to ndarray.reshape.
resize
resize(
*new_shape, refcheck=True
)
Scalar method identical to ndarray.resize.
round
round(
decimals=0, out=None
)
Scalar method identical to ndarray.round.
searchsorted
searchsorted(
v, /, side='left', sorter=None
)
Scalar method identical to ndarray.searchsorted.
setfield
setfield(
val, /, dtype, offset=0
)
Scalar method identical to ndarray.setfield.
setflags
setflags(
*, write=None, align=None, uic=None
)
Scalar method identical to ndarray.setflags.
sort
sort(
axis=-1, kind=None, order=None, *, stable=None
)
Scalar method identical to ndarray.sort.
squeeze
squeeze(
axis=None
)
Scalar method identical to ndarray.squeeze.
std
std(
axis=None, dtype=None, out=None, ddof=0, **kwargs
)
Scalar method identical to ndarray.std.
sum
sum(
axis=None, dtype=None, out=None, **kwargs
)
Scalar method identical to ndarray.sum.
swapaxes
swapaxes(
axis1, axis2, /
)
Scalar method identical to ndarray.swapaxes.
take
take(
indices, /, axis=None, out=None, mode='raise'
)
Scalar method identical to ndarray.take.
to_device
to_device(
device, /, *, stream=None
)
Scalar method identical to ndarray.to_device.
tobytes
tobytes(
order='C'
)
Scalar method identical to ndarray.tobytes.
tofile
tofile(
fid, /, sep='', format='%s'
)
Scalar method identical to ndarray.tofile.
tolist
tolist()
Scalar method identical to ndarray.tolist.
trace
trace(
offset=0, axis1=0, axis2=1, dtype=None, out=None
)
Scalar method identical to ndarray.trace.
transpose
transpose(
*axes
)
Scalar method identical to ndarray.transpose.
var
var(
axis=None, dtype=None, out=None, ddof=0, **kwargs
)
Scalar method identical to ndarray.var.
view
view(
*args, **kwargs
)
Scalar method identical to ndarray.view.
__abs__
__abs__()
abs(self)
__add__
__add__(
value, /
)
Return self+value.
__and__
__and__(
value, /
)
Return self&value.
__array__
__array__()
sc.array(dtype) return 0-dim array from scalar with specified dtype
__bool__
__bool__()
True if self else False
__eq__
__eq__(
value, /
)
Return self==value.
__floordiv__
__floordiv__(
value, /
)
Return self//value.
__ge__
__ge__(
value, /
)
Return self>=value.
__getitem__
__getitem__(
key, /
)
Return self[key].
__gt__
__gt__(
value, /
)
Return self>value.
__invert__
__invert__()
~self
__le__
__le__(
value, /
)
Return self<=value.
__lshift__
__lshift__(
value, /
)
Return self<<value.
__lt__
__lt__(
value, /
)
Return self<value.
__mod__
__mod__(
value, /
)
Return self%value.
__mul__
__mul__(
value, /
)
Return self*value.
__ne__
__ne__(
value, /
)
Return self!=value.
__neg__
__neg__()
-self
__or__
__or__(
value, /
)
Return self|value.
__pos__
__pos__()
+self
__pow__
__pow__(
value, mod, /
)
Return pow(self, value, mod).
__radd__
__radd__(
value, /
)
Return value+self.
__rand__
__rand__(
value, /
)
Return value&self.
__rfloordiv__
__rfloordiv__(
value, /
)
Return value//self.
__rlshift__
__rlshift__(
value, /
)
Return value<<self.
__rmod__
__rmod__(
value, /
)
Return value%self.
__rmul__
__rmul__(
value, /
)
Return value*self.
__ror__
__ror__(
value, /
)
Return value|self.
__rpow__
__rpow__(
value, mod, /
)
Return pow(value, self, mod).
__rrshift__
__rrshift__(
value, /
)
Return value>>self.
__rshift__
__rshift__(
value, /
)
Return self>>value.
__rsub__
__rsub__(
value, /
)
Return value-self.
__rtruediv__
__rtruediv__(
value, /
)
Return value/self.
__rxor__
__rxor__(
value, /
)
Return value^self.
__sub__
__sub__(
value, /
)
Return self-value.
__truediv__
__truediv__(
value, /
)
Return self/value.
__xor__
__xor__(
value, /
)
Return self^value.