astro py:docs

- Index
- Modules

### Navigation

- next »
- « previous |
- Astropy v0.3 »
- Data Tables (`astropy.table`) »
- vstack

# vstack

`astropy.table.operations.``vstack`(tables, join_type='outer', metadata_conflicts='warn')

  Stack tables vertically (along rows)

  A `join_type` of ‘exact’ means that the tables must all have exactly the same column names (though the order can vary). If `join_type` is ‘inner’ then the intersection of common columns will be output. A value of ‘outer’ (default) means the output will have the union of all columns, with table values being masked where no common values are available.

  Parameters:

  tables : Table or list of Table objects

  > Table(s) to stack along rows (vertically) with the current table

  join_type : str

  > Join type (‘inner’ | ‘exact’ | ‘outer’), default is ‘exact’

  metadata_conflicts : str

  > How to proceed with metadata conflicts. This should be one of:
  >   - `'silent'`: silently pick the last conflicting meta-data value
  >   - `'warn'`: pick the last conflicting meta-data value, but emit a warning (default)
  >   - `'error'`: raise an exception.

  Examples

  To stack two tables along rows do:

      >>> from astropy.table import vstack, Table
      >>> t1 = Table({'a': [1, 2], 'b': [3, 4]}, names=('a', 'b'))
      >>> t2 = Table({'a': [5, 6], 'b': [7, 8]}, names=('a', 'b'))
      >>> print t1
       a   b
      --- ---
        1   3
        2   4
      >>> print t2
       a   b
      --- ---
        5   7
        6   8
      >>> print vstack([t1, t2])
       a   b
      --- ---
        1   3
        2   4
        5   7
        6   8