| AHELP for CIAO 4.4 | col_exists |
Context: crates |
Synopsis
Determine if a column exists in a crate.
Syntax
col_exists(crate, name)
Description
- crate - input crate
- name - the column name to check
The col_exists command returns True if the column exists and False if not. The name comparison is case-insensitive.
The get_col_names() routine ("ahelp get_col_names") can be used to find the columns in a Crate.
Example
>>> cr = read_file("evt2.fits")
>>> col_exists(cr, "ENERGY")
True
>>> col_exists(cr, "energy")
TrueNote that the check is case-insensitive on the column name.
Changes in CIAO 4.4
The return value is now True or False rather than 1 or 0.
Bugs
See the bug pages on the CIAO website for an up-to-date listing of known bugs.
Refer to the CIAO bug pages for an up-to-date listing of known issues.
See Also
- contrib
- add_colvals
- crates
- add_col, copy_colvals, delete_col, get_col, get_col_names, get_colvals, get_number_cols, is_pha, is_rmf, is_virtual, key_exists, set_colvals

![[CIAO Logo]](../imgs/ciao_logo_navbar.gif)