|
|||
NRAO Home > CASA > CASA Cookbook and User Reference Manual |
|
B.5 Dictionaries
Python dictionaries are data structures that contain key:value pairs, sort of like a hash array. These are useful to store mini-databases of things. In CASA, the parameter values are kept in a dictionary behind the scenes.
To initialize a dictionary, say we call it mydict, for use:
To add members:
CASA <9>: mydict[’flux’] = 5.4
To see its contents:
Out[10]: {’flux’: 5.4000000000000004, ’source’: ’0137+331’}
CASA <11>: print mydict
{’source’: ’0137+331’, ’flux’: 5.4000000000000004}
To access a specific entry:
5.4
More information about CASA may be found at the
CASA web page
Copyright © 2010 Associated Universities Inc., Washington, D.C.
This code is available under the terms of the GNU General Public Lincense
Home |
Contact Us |
Directories |
Site Map |
Help |
Privacy Policy |
Search