crandas.compat¶
This module provides access to deprecated functionality for backward compatibility purposes.
Merge (pre-v1.11.0 version)¶
Crandas 1.11.0 introduced a new merge that, while offering the same API to the end user, uses a different underlying engine command. This module offers access to the pre-v1.11.0 version for older scripts that rely on it, and will be removed in a future release.
To use this function, import crandas.compat
and use function crandas.compat.merge_v1
,
or do from crandas.compat import merge_v1
and use function merge_v1
.
- crandas.compat.merge_v1.merge(left, right, how='inner', on=None, left_on=None, right_on=None, validate='one_to_one', **query_args)¶
Merge tables using a database-style join. Implements pandas.merge.
Deprecated since version 1.12.
This function is deprecated and will be removed in the future. The function
crandas.read_csv()
supports the same arguments (and more). The present function is offered to still allow to perform previously authorized queries that use the old merge, and that rely on certain old behaviour (such as filling in zeros instead of returning nullable columns).- The following types of merge are supported:
inner join: returns only the rows where the join columns match; requires join column values to be unique in both tables
outer join: returns rows from both tables, matched where possible; requires join column values to be unique in both tables
left join: return rows of left table in original order, matched with a row of the right table where possible; requires join column values to be unique in right table
Columns to join on are given either by a common
on
argument, or separateleft_on
andright_on
arguments for the left and right tables. To perform a left join where the join column values are not unique, provide aCDataFrameGroupBy
object (as returned byCDataFrame.groupby()
) asleft_on
. Currently, this is only possible with a single join column.- Parameters:
left (CDataFrame) – Left table to be joined
right (CDataFrame) – Right table to be joined
how ("inner" (default), "outer", or "left", optional) – Type of join
on (str or list of str, optional) – Column(s) to join on; must be common to both tables
left_on (str, list of str, or CDataFrameGroupBy, optional) – Column(s) of the left table to join on
right_on (str or list of str, optional) – Column(s) of the right table to join on, by default None
validate (str, optional) – Type of validation; currently, only join with one_to_one validation is supported, by default “one_to_one”
query_args – VDL query arguments
- Returns:
Result of the merging operation
- Return type:
- Raises:
MergeError – Values of the join columns are not unique