7. Bind
Concatenate or Merge DataFrames
Click Bind from the Data Analysis category.
Bind type: Select a bind type.
Concat: Concatenates dataframes in the row or column direction.
Merge: Merge two dataframes based on a common column.
Concat
DataFrame: Select the dataframes you want to combine.
Join: Choose a join method.
Outer: When concatenating dataframes, unmatched indices are filled with NaNs.
Inner: Concatenate only data with matching indexes (non-matching data will be removed).
Axis: Select the direction of the connection.
Index: Concatenates data in the row direction (vertical).
Column: Concatenate data in the column direction (horizontal).
Sort: Choose whether you want to sort the indexes. Sorting is done in ascending order by index number, which may change the order of the data.
User Option: You can add options beyond what Visual Python provides.
Allocate to: Specify a variable name to assign to the result.
Reset Index: Reset the index to specify a new default integer index.
Code View: Preview the code that will be output.
Data View: Preview the output that will be printed.
Run: Print and run the code.
Merge
Merge two dataframes based on a standard column, creating two new columns for the values from each dataframe.
Left Data, Right Data: Select the two dataframes you want to merge.
How: Choose a merge method.
Inner: Merge based on common values in key columns, only common values will be kept.
Outer: Merge based on all rows in the key column, and values that are not common and do not exist in either dataframe will be filled with NaN.
Left: Merge based on all rows in the key column in the left dataframe.
Right: Merge based on all rows in the key column in the right dataframe.
Cross: Outputs all combinations of data, regardless of the value in the key column.
On: Allows you to merge based on specific columns. The columns selected must exist in both dataframes in common.
Left on, Right on: You can select the columns in both dataframes that you want to base the merge on, respectively.
Suffixes: If you have columns with the same name other than the common key column, add a suffix to differentiate them.
User Option: You can add options beyond what Visual Python provides.
Allocate to: Specify a variable name to assign to the result.
Reset Index: Reset the index to specify a new default integer index.
Code View: Preview the code that will be output.
Data View: Preview the output that will be printed.
Run: Print and run the code.
Last updated