{ } Raw JSON

bundles / astropy latest / astropy / io / fits / column / _get_index

function

astropy.io.fits.column:_get_index

source: /astropy/io/fits/column.py :2119

Signature

def   _get_index ( names key )

Summary

Get the index of the key in the names list.

Extended Summary

The key can be an integer or string. If integer, it is the index in the list. If string,

  • Field (column) names are case sensitive: you can have two different columns called 'abc' and 'ABC' respectively.

  • When you refer to a field (presumably with the field method), it will try to match the exact name first, so in the example in (a), field('abc') will get the first field, and field('ABC') will get the second field.

If there is no exact name matched, it will try to match the name with case insensitivity. So, in the last example, field('Abc') will cause an exception since there is no unique mapping. If there is a field named "XYZ" and no other field name is a case variant of "XYZ", then field('xyz'), field('Xyz'), etc. will get this field.

Aliases

  • astropy.io.fits.column._get_index