Ecsv

class astropy.io.ascii.Ecsv[source] [edit on github]

Bases: astropy.io.ascii.Basic

Read a file which conforms to the ECSV (Enhanced Character Separated Values) format. This format allows for specification of key table and column meta-data, in particular the data type and unit. For details see: https://github.com/astropy/astropy-APEs/blob/master/APE6.rst.

Examples

>>> from astropy.table import Table
>>> ecsv_content = '''# %ECSV 0.9
... # ---
... # datatype:
... # - {name: a, unit: m / s, datatype: int64, format: '%03d'}
... # - {name: b, unit: km, datatype: int64, description: This is column b}
... a b
... 001 2
... 004 3
... '''
>>> Table.read(ecsv_content, format='ascii.ecsv')
<Table length=2>
  a     b
m / s   km
int64 int64
----- -----
  001     2
  004     3

Methods Summary

update_table_data(table) Update table columns in place if mixin columns are present.

Methods Documentation

update_table_data(table)[source] [edit on github]

Update table columns in place if mixin columns are present.

This is a hook to allow updating the table columns after name filtering but before setting up to write the data. This is currently only used by ECSV and is otherwise just a pass-through.

Parameters:
table : astropy.table.Table

Input table for writing

Returns:
table : astropy.table.Table

Output table for writing