Note

This is an old version of the documentation. See http://docs.astropy.org/en/stable for the latest version.

join

astropy.table.join(left, right, keys=None, join_type=u'inner', uniq_col_name=u'{col_name}_{table_name}', table_names=[u'1', u'2'], metadata_conflicts=u'warn')[source] [edit on github]

Perform a join of the left table with the right table on specified keys.

Parameters:

left : Table object or a value that will initialize a Table object

Left side table in the join

right : Table object or a value that will initialize a Table object

Right side table in the join

keys : str or list of str

Name(s) of column(s) used to match rows of left and right tables. Default is to use all columns which are common to both tables.

join_type : str

Join type (‘inner’ | ‘outer’ | ‘left’ | ‘right’), default is ‘inner’

uniq_col_name : str or None

String generate a unique output column name in case of a conflict. The default is ‘{col_name}_{table_name}’.

table_names : list of str or None

Two-element list of table names used when generating unique output column names. The default is [‘1’, ‘2’].

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.
Returns:

joined_table : Table object

New table containing the result of the join operation.