[AstroPy] Lower(Upper)case astropy table columns

Eduardo Bañados Torres eebanado at uc.cl
Wed Feb 26 11:23:12 EST 2014


Hi all,

is there a way to lower case the columns of a table? I have tables that
sometimes come with the uppercase and other lowercase keywords. By now I am
just using try/except but this gets messy when the number of columns is
large. I was expecting to exist something like:

table.colnames.lower()

Is there something like that? or how could I work this around

Thanks!

Eduardo Bañados

-------------------------------------

For example
from astropy.table import Table
import numpy as np

t = Table(arr, names=('RA', 'DEC', 'REDSHIFT'))
t['RA']
#<Column name='RA' unit=None format=None description=None>
#array([ 0,  3,  6,  9, 12])
#I can access the table by t['RA']
#but I need to lowercase the columns to access them as
t['ra']
#KeyError: 'ra'
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20140226/76c0708e/attachment.html>


More information about the AstroPy mailing list