Skip to main content

Column.zip

ziprightkeep_unmatchedright_prefixon_problems

Group: Calculations
Aliases: join by row position

Documentation

Joins this column with another column (or table) by zipping rows from both together - the first row of the left column is correlated with the first one of the right one etc. zip always returns a Table.

  • If the columns have different number of rows and keep_unmatched is set to Report_Unmatched, the join will report Row_Count_Mismatch.

Arguments

  • right: The column or table to join with.
  • keep_unmatched: If set to True, the result will include as many rows as the larger of the two columns - the last rows of the larger column will have nulls for the smaller one. If set to False, the result will have as many rows as the smaller of the two columns - the additional rows of the larger column will be discarded. The default value is Report_Unmatched which means that the user expects that two columns should have the same amount of rows; if they do not, the behaviour is the same as if it was set to True - i.e. the unmatched rows are kept with Nothing values for the other column, but a Row_Count_Mismatch problem is also reported.
  • right_prefix: The prefix added to right column column names in case of name conflict. See "Column Renaming" below for more information.
  • on_problems: Specifies how to handle problems if they occur, reporting them as warnings by default.

Remarks

Column Renaming

If columns from the two columns have colliding names, a prefix (by default Right ) is added to the name of the column from the right column. The left column remains unchanged. It is possible that the new name will be in use, in this case it will be resolved using the normal renaming strategy - adding subsequent 1, 2 etc.

Row Ordering For In-Memory Columns

This operation requires a well-defined order of rows in the input columns. In-memory columns rely on the ordering stemming directly from their layout in memory. Database columns may not impose a deterministic ordering. The existing ordering can be overridden by specifying a different ordering using Column.sort. If no primary key was defined nor any ordering was specified explicitly by the user, the order of columns is undefined and the operation will fail, reporting a Undefined_Column_Order problem and returning an empty table.