API Reference for Enthought Tool Suite 3.2.0
Utility functions for physical quantities
Given two dictionaries, add values by key, removing zero entries
- a, b : dict
- the dictionaries to be added.
Given two dictionaries:
>>> a = {'a': 3.0, 'b': -4.0, 'd': 2.0}
>>> b = {'a': 1.5, 'c': 12.0, 'd': -2.0}
>>> dict_add(a, b)
{'a': 4.5, 'b': -4.0, 'c': 12.0}
Given a dictionary, divide values by a scalar
- a: dict
- the dictionary to be divided.
- n: float
- the scalar to divide by
Given a dictionary and scalar:
>>> a = {'a': 2.0, 'b': -4.0}
>>> n = 0.5
>>> dict_div(a, n)
{'a': 4.0, 'b': -8.0}
Given a dictionary, multiply values by a scalar
- a: dict
- the dictionary to be multiplied.
- n: float
- the scalar to multiply by
Given a dictionary and scalar:
>>> a = {'a': 2.0, 'b': -4.0}
>>> n = 1.5
>>> dict_mul(a, n)
{'a': 3.0, 'b': -6.0}
Given two dictionaries, subtract values by key, removing zero entries
Given two dictionaries:
>>> a = {'a': 3.0, 'b': -4.0, 'd': 2.0}
>>> b = {'a': 1.5, 'c': 12.0, 'd': 2.0}
>>> dict_sub(a, b)
{'a': 1.5, 'b': -4.0, 'c': -12.0}
Format a dictionary of symbol, power pairs
Convert a value to a power expression in English
Convert a value to a power expressed in standard Python syntax
Convert a value to a power expression in TeX/LaTeX
Convert a value to a power using unicode superscripts
| Local name | Refers to |
|---|---|
| copy | copy.copy |
| division | __future__.division |
© Copyright 2002-2009 Enthought, Inc.