FixedWidthTwoLine

class astropy.io.ascii.fixedwidth.FixedWidthTwoLine(position_line=1, position_char='-', delimiter_pad=None, bookend=False)[source] [edit on github]

Bases: astropy.io.ascii.fixedwidth.FixedWidth

Read or write a fixed width table which has two header lines. The first header line defines the column names and the second implicitly defines the column positions. Examples:

# Typical case with column extent defined by ---- under column names.

 col1    col2         <== header_start = 0
-----  ------------   <== position_line = 1, position_char = "-"
  1     bee flies     <== data_start = 2
  2     fish swims

# Pretty-printed table

+------+------------+
| Col1 |   Col2     |
+------+------------+
|  1.2 | "hello"    |
|  2.4 | there world|
+------+------------+

See the Fixed-width Gallery for specific usage examples.

Parameters:
  • position_line – row index of line that specifies position (default = 1)
  • position_char – character used to write the position line (default = “-”)
  • delimiter_pad – padding around delimiter when writing (default = None)
  • bookend – put the delimiter at start and end of line when writing (default = False)

Page Contents