Scalar

class lsst.analysis.tools.Scalar

Bases: Number, number

This is an interface only class, and is intended to abstract around all the various types of numbers used in Python.

This has been tried many times with various levels of success in python, and this is another attempt. However, as this class is only intended as an interface, and not something concrete to use it works.

Users should not directly instantiate from this class, instead they should use a built in python number type, or a numpy number.

Attributes Summary

T

Scalar attribute identical to the corresponding array attribute.

base

Scalar attribute identical to the corresponding array attribute.

data

Pointer to start of data.

dtype

Get array data-descriptor.

flags

The integer value of flags.

flat

A 1-D view of the scalar.

imag

The imaginary part of the scalar.

itemsize

The length of one element in bytes.

nbytes

The length of the scalar in bytes.

ndim

The number of array dimensions.

real

The real part of the scalar.

shape

Tuple of array dimensions.

size

The number of elements in the gentype.

strides

Tuple of bytes steps in each dimension.

Methods Summary

all

Scalar method identical to the corresponding array attribute.

any

Scalar method identical to the corresponding array attribute.

argmax

Scalar method identical to the corresponding array attribute.

argmin

Scalar method identical to the corresponding array attribute.

argsort

Scalar method identical to the corresponding array attribute.

astype

Scalar method identical to the corresponding array attribute.

byteswap

Scalar method identical to the corresponding array attribute.

choose

Scalar method identical to the corresponding array attribute.

clip

Scalar method identical to the corresponding array attribute.

compress

Scalar method identical to the corresponding array attribute.

conj

conjugate

Scalar method identical to the corresponding array attribute.

copy

Scalar method identical to the corresponding array attribute.

cumprod

Scalar method identical to the corresponding array attribute.

cumsum

Scalar method identical to the corresponding array attribute.

diagonal

Scalar method identical to the corresponding array attribute.

dump

Scalar method identical to the corresponding array attribute.

dumps

Scalar method identical to the corresponding array attribute.

fill

Scalar method identical to the corresponding array attribute.

flatten

Scalar method identical to the corresponding array attribute.

getfield

Scalar method identical to the corresponding array attribute.

item

Scalar method identical to the corresponding array attribute.

itemset

Scalar method identical to the corresponding array attribute.

max

Scalar method identical to the corresponding array attribute.

mean

Scalar method identical to the corresponding array attribute.

min

Scalar method identical to the corresponding array attribute.

newbyteorder([new_order])

Return a new dtype with a different byte order.

nonzero

Scalar method identical to the corresponding array attribute.

prod

Scalar method identical to the corresponding array attribute.

ptp

Scalar method identical to the corresponding array attribute.

put

Scalar method identical to the corresponding array attribute.

ravel

Scalar method identical to the corresponding array attribute.

repeat

Scalar method identical to the corresponding array attribute.

reshape

Scalar method identical to the corresponding array attribute.

resize

Scalar method identical to the corresponding array attribute.

round

Scalar method identical to the corresponding array attribute.

searchsorted

Scalar method identical to the corresponding array attribute.

setfield

Scalar method identical to the corresponding array attribute.

setflags

Scalar method identical to the corresponding array attribute.

sort

Scalar method identical to the corresponding array attribute.

squeeze

Scalar method identical to the corresponding array attribute.

std

Scalar method identical to the corresponding array attribute.

sum

Scalar method identical to the corresponding array attribute.

swapaxes

Scalar method identical to the corresponding array attribute.

take

Scalar method identical to the corresponding array attribute.

tobytes

tofile

Scalar method identical to the corresponding array attribute.

tolist

Scalar method identical to the corresponding array attribute.

tostring

Scalar method identical to the corresponding array attribute.

trace

Scalar method identical to the corresponding array attribute.

transpose

Scalar method identical to the corresponding array attribute.

var

Scalar method identical to the corresponding array attribute.

view

Scalar method identical to the corresponding array attribute.

Attributes Documentation

T

Scalar attribute identical to the corresponding array attribute.

Please see ndarray.T.

base

Scalar attribute identical to the corresponding array attribute.

Please see ndarray.base.

data

Pointer to start of data.

dtype

Get array data-descriptor.

flags

The integer value of flags.

flat

A 1-D view of the scalar.

imag

The imaginary part of the scalar.

itemsize

The length of one element in bytes.

nbytes

The length of the scalar in bytes.

ndim

The number of array dimensions.

real

The real part of the scalar.

shape

Tuple of array dimensions.

size

The number of elements in the gentype.

strides

Tuple of bytes steps in each dimension.

Methods Documentation

all()

Scalar method identical to the corresponding array attribute.

Please see ndarray.all.

any()

Scalar method identical to the corresponding array attribute.

Please see ndarray.any.

argmax()

Scalar method identical to the corresponding array attribute.

Please see ndarray.argmax.

argmin()

Scalar method identical to the corresponding array attribute.

Please see ndarray.argmin.

argsort()

Scalar method identical to the corresponding array attribute.

Please see ndarray.argsort.

astype()

Scalar method identical to the corresponding array attribute.

Please see ndarray.astype.

byteswap()

Scalar method identical to the corresponding array attribute.

Please see ndarray.byteswap.

choose()

Scalar method identical to the corresponding array attribute.

Please see ndarray.choose.

clip()

Scalar method identical to the corresponding array attribute.

Please see ndarray.clip.

compress()

Scalar method identical to the corresponding array attribute.

Please see ndarray.compress.

conj()
conjugate()

Scalar method identical to the corresponding array attribute.

Please see ndarray.conjugate.

copy()

Scalar method identical to the corresponding array attribute.

Please see ndarray.copy.

cumprod()

Scalar method identical to the corresponding array attribute.

Please see ndarray.cumprod.

cumsum()

Scalar method identical to the corresponding array attribute.

Please see ndarray.cumsum.

diagonal()

Scalar method identical to the corresponding array attribute.

Please see ndarray.diagonal.

dump()

Scalar method identical to the corresponding array attribute.

Please see ndarray.dump.

dumps()

Scalar method identical to the corresponding array attribute.

Please see ndarray.dumps.

fill()

Scalar method identical to the corresponding array attribute.

Please see ndarray.fill.

flatten()

Scalar method identical to the corresponding array attribute.

Please see ndarray.flatten.

getfield()

Scalar method identical to the corresponding array attribute.

Please see ndarray.getfield.

item()

Scalar method identical to the corresponding array attribute.

Please see ndarray.item.

itemset()

Scalar method identical to the corresponding array attribute.

Please see ndarray.itemset.

max()

Scalar method identical to the corresponding array attribute.

Please see ndarray.max.

mean()

Scalar method identical to the corresponding array attribute.

Please see ndarray.mean.

min()

Scalar method identical to the corresponding array attribute.

Please see ndarray.min.

newbyteorder(new_order='S', /)

Return a new dtype with a different byte order.

Changes are also made in all fields and sub-arrays of the data type.

The new_order code can be any from the following:

  • ‘S’ - swap dtype from current to opposite endian

  • {‘<’, ‘little’} - little endian

  • {‘>’, ‘big’} - big endian

  • {‘=’, ‘native’} - native order

  • {‘|’, ‘I’} - ignore (no change to byte order)

Parameters:
new_orderstr, optional

Byte order to force; a value from the byte order specifications above. The default value (‘S’) results in swapping the current byte order.

Returns:
new_dtypedtype

New dtype object with the given change to the byte order.

nonzero()

Scalar method identical to the corresponding array attribute.

Please see ndarray.nonzero.

prod()

Scalar method identical to the corresponding array attribute.

Please see ndarray.prod.

ptp()

Scalar method identical to the corresponding array attribute.

Please see ndarray.ptp.

put()

Scalar method identical to the corresponding array attribute.

Please see ndarray.put.

ravel()

Scalar method identical to the corresponding array attribute.

Please see ndarray.ravel.

repeat()

Scalar method identical to the corresponding array attribute.

Please see ndarray.repeat.

reshape()

Scalar method identical to the corresponding array attribute.

Please see ndarray.reshape.

resize()

Scalar method identical to the corresponding array attribute.

Please see ndarray.resize.

round()

Scalar method identical to the corresponding array attribute.

Please see ndarray.round.

searchsorted()

Scalar method identical to the corresponding array attribute.

Please see ndarray.searchsorted.

setfield()

Scalar method identical to the corresponding array attribute.

Please see ndarray.setfield.

setflags()

Scalar method identical to the corresponding array attribute.

Please see ndarray.setflags.

sort()

Scalar method identical to the corresponding array attribute.

Please see ndarray.sort.

squeeze()

Scalar method identical to the corresponding array attribute.

Please see ndarray.squeeze.

std()

Scalar method identical to the corresponding array attribute.

Please see ndarray.std.

sum()

Scalar method identical to the corresponding array attribute.

Please see ndarray.sum.

swapaxes()

Scalar method identical to the corresponding array attribute.

Please see ndarray.swapaxes.

take()

Scalar method identical to the corresponding array attribute.

Please see ndarray.take.

tobytes()
tofile()

Scalar method identical to the corresponding array attribute.

Please see ndarray.tofile.

tolist()

Scalar method identical to the corresponding array attribute.

Please see ndarray.tolist.

tostring()

Scalar method identical to the corresponding array attribute.

Please see ndarray.tostring.

trace()

Scalar method identical to the corresponding array attribute.

Please see ndarray.trace.

transpose()

Scalar method identical to the corresponding array attribute.

Please see ndarray.transpose.

var()

Scalar method identical to the corresponding array attribute.

Please see ndarray.var.

view()

Scalar method identical to the corresponding array attribute.

Please see ndarray.view.