7. Bind

Concatenate or Merge DataFrames

  1. Select Bind from the Data Analysis category.

  1. Choose the Bind Type.

2-1. Concat concatenates dataframes along rows or columns.

2-2. Merge merges "two" dataframes based on a common column.


Concat

  1. Select the dataframes to concatenate.

  2. Choose the concatenation method

2-1. Outer: When concatenating dataframes, non-matching indices are filled with NaN.

2-2. Inner concatenates only the data with matching indices (non-matching data is removed.)

  1. Choose the concatenation direction.

3-1. Index concatenates data along the row direction (vertical).

3-2. Column concatenates data along the column direction (horizontal).

  1. Choose whether to sort the index. Sorting is done in ascending order based on index numbers, which may alter the data order.

  2. Add additional options beyond those provided by Visual Python.

  3. Specify the variable name to assign to the result.

  4. Reset the index to assign a new default integer index.

  5. Preview the code that will be output in Code View.

  6. Preview the resulting dataframe in Data View.

  7. Execute the code.


Merge

Merge two dataframes based on a standard column, creating two new columns for the values from each dataframe.

  1. Select the two dataframes to merge.

  2. Choose the merging method.

2-1. Inner merges based on the common values in the key column, keeping only the common values.

2-2. Outer merges based on all rows in the key column, filling with input data.

2-3. Left merges based on all rows in the key column from the left dataframe.

2-4. Left merges based on all rows in the key column from the right dataframe.

2-5. Cross outputs all combinations of data, regardless of the values in the key column.

  1. Select the key column that will be the reference for merging; it must be common to both dataframes.

  2. Optionally, select the key column separately for each dataframe.

  3. Append a suffix to columns with the same name other than the common key column.

  4. Add additional options beyond those provided by Visual Python.

  5. Specify the variable name to assign to the result.

  6. Reset the index to assign a new default integer index.

  7. Preview the code that will be output in Code View.

  8. Preview the resulting dataframe in Data View.

  9. Execute the code.

Last updated