API Reference for Enthought Tool Suite 3.0.1

A Quantity is a data item (usually scalar or array) with associated units and name.

Attributes

data
scalar, array, or Quantity: A scalar value array of values.
units: unit
A units object that defines the type of units for values in the data attribute.
name: string
Default is the empty string. Name of the Quantity. This is useful as a label for plots, etc.
family_name: string
Used for unit_system conversion and keyed by styles

Description

A Quantity object is used to associate units and perhaps a name with a scalar value or array of values. It is little more than a structure to group this information together.

Examples

>>> # scalar example
>>> from units.SI import meter, second
>>> Quantity(2.2, meter/second)
Quantity(2.2, 1.0*m*s**-1)
>>> # an array example
>>> from scipy import arange
>>> data = arange(3.)
>>> Quantity(data, meter, 'depth')
Quantity(depth, [ 0.  1.  2.], 1.0*m)

Inherits from

Attributes

Inherited from base classes

Method summary

Inherited from base classes

Methods

© Copyright 2002-2008 Enthought, Inc.