@@ -4,85 +4,63 @@ description: Concatenate or Merge DataFrames
44
55#7. Bind
66
7+ <figure ><img src =" ../.gitbook/assets/image (221).png " alt =" " width =" 332 " ><figcaption ></figcaption ></figure >
78
9+ 1 . Click_ ** Bind** _ from the_ ** Data Analysis** _ category.
810
9- <figure ><img src =" ../.gitbook/assets/image (48 ).png " alt =" " width =" 309 " ><figcaption ></figcaption ></figure >
11+ <figure ><img src =" ../.gitbook/assets/image (222 ).png " alt =" " width =" 465 " ><figcaption ></figcaption ></figure >
1012
11- 1 . Select_ ** Bind** _ from the Data Analysis category.
12-
13-
14-
15- <figure ><img src =" ../.gitbook/assets/image (49).png " alt =" " width =" 563 " ><figcaption ></figcaption ></figure >
16-
17- 2 . Choose the_ ** Bind Type** _ .
18-
19-   ; 2-1._ ** Concat** _ concatenates dataframes along rows or columns.
20-
21-   ; 2-2._ ** Merge** _ merges "two" dataframes based on a common column.
13+ 2 . _ ** Bind type** _ : Select a bind type.
14+ 1 . _ ** Concat** _ : Concatenates dataframes in the row or column direction.
15+ 2 . _ ** Merge** _ : Merge two dataframes based on a common column.
2216
2317
2418
2519***
2620
2721###Concat
2822
23+ <figure ><img src =" ../.gitbook/assets/image (223).png " alt =" " width =" 446 " ><figcaption ></figcaption ></figure >
2924
30-
31- <figure ><img src =" ../.gitbook/assets/image (51).png " alt =" " width =" 563 " ><figcaption ></figcaption ></figure >
32-
33- 1 . Select the dataframes to concatenate.
34- 2 . Choose the concatenation method
35-
36-   ; 2-1._ ** Outer** _ : When concatenating dataframes, non-matching indices are filled with NaN.
37-
38-   ; 2-2._ ** Inner** _ concatenates only the data with matching indices (non-matching data is removed.)
39-
40- 3 . Choose the concatenation direction.
41-
42-   ; 3-1._ ** Index** _ concatenates data along the row direction (vertical).
43-
44-   ; 3-2._ ** Column** _ concatenates data along the column direction (horizontal).
45-
46- 4 . Choose whether to sort the index. Sorting is done in ascending order based on index numbers, which may alter the data order.
47- 5 . Add additional options beyond those provided by Visual Python.
48- 6 . Specify the variable name to assign to the result.
49- 7 . Reset the index to assign a new default integer index.
50- 8 . Preview the code that will be output in_ ** Code View** _ .
51- 9 . Preview the resulting dataframe in_ ** Data View** _ .
52- 10 . Execute the code.
25+ 1 . _ ** DataFrame** _ : Select the dataframes you want to combine.
26+ 2 . _ ** Join** _ : Choose a join method.
27+ 1 . _ ** Outer** _ : When concatenating dataframes, unmatched indices are filled with NaNs.
28+ 2 . _ ** Inner** _ : Concatenate only data with matching indexes (non-matching data will be removed).
29+ 3 . _ ** Axis** _ : Select the direction of the connection.
30+ 1 . _ ** Index** _ : Concatenates data in the row direction (vertical).
31+ 2 . _ ** Column** _ : Concatenate data in the column direction (horizontal).
32+ 4 . _ ** 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.
33+ 5 . _ ** User Option** _ : You can add options beyond what Visual Python provides.
34+ 6 . _ ** Allocate to** _ : Specify a variable name to assign to the result.
35+ 7 . _ ** Reset Index** _ : Reset the index to specify a new default integer index.
36+ 8 . _ ** Code View** _ : Preview the code that will be output.
37+ 9 . _ ** Data View** _ : Preview the output that will be printed.
38+ 10 . _ ** Run** _ : Print and run the code.
5339
5440
5541
5642***
5743
5844###Merge
5945
60-
61-
62- <figure ><img src =" ../.gitbook/assets/image (52).png " alt =" " width =" 563 " ><figcaption ></figcaption ></figure >
63-
64- _ ** Merge** _ two dataframes based on a standard column, creating two new columns for the values from each dataframe.
65-
66- 1 . Select the two dataframes to merge.
67- 2 . Choose the merging_ ** method** _ .
68-
69-   ; 2-1._ ** Inner** _ merges based on the common values in the key column, keeping only the common values.
70-
71-   ; 2-2._ ** Outer** _ merges based on all rows in the key column, filling with input data.
72-
73-   ; 2-3._ ** Left** _ merges based on all rows in the key column from the left dataframe.
74-
75-   ; 2-4._ ** Left** _ merges based on all rows in the key column from the right dataframe.
76-
77-   ; 2-5._ ** Cross** _ outputs all combinations of data, regardless of the values in the key column.
78-
79- 3 . Select the key column that will be the reference for merging; it must be common to both dataframes.
80- 4 . Optionally, select the key column separately for each dataframe.
81- 5 . Append a suffix to columns with the same name other than the common key column.
82- 6 . Add additional options beyond those provided by Visual Python.
83- 7 . Specify the variable name to assign to the result.
84- 8 . Reset the index to assign a new default integer index.
85- 9 . Preview the code that will be output in_ ** Code View** _ .
86- 10 . Preview the resulting dataframe in_ ** Data View** _ .
87- 11 . Execute the code.
46+ <figure ><img src =" ../.gitbook/assets/image (224).png " alt =" " width =" 442 " ><figcaption ></figcaption ></figure >
47+
48+ * _ ** Merge** _ two dataframes based on a standard column, creating two new columns for the values from each dataframe.
49+
50+ 1 . _ ** Left Data** ,** Right Data** _ : Select the two dataframes you want to merge.
51+ 2 . _ ** How** _ : Choose a merge method.
52+ 1 . _ ** Inner** _ : Merge based on common values in key columns, only common values will be kept.
53+ 2 . _ ** 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.
54+ 3 . _ ** Left** _ : Merge based on all rows in the key column in the left dataframe.
55+ 4 . _ ** Right** _ : Merge based on all rows in the key column in the right dataframe.
56+ 5 . _ ** Cross** _ : Outputs all combinations of data, regardless of the value in the key column.
57+ 3 . _ ** On** _ : Allows you to merge based on specific columns. The columns selected must exist in both dataframes in common.
58+ 4 . _ ** Left on** ,** Right on** _ : You can select the columns in both dataframes that you want to base the merge on, respectively.
59+ 5 . _ ** Suffixes** _ : If you have columns with the same name other than the common key column, add a suffix to differentiate them.
60+ 6 . _ ** User Option** _ : You can add options beyond what Visual Python provides.
61+ 7 . _ ** Allocate to** _ : Specify a variable name to assign to the result.
62+ 8 . _ ** Reset Index** _ : Reset the index to specify a new default integer index.
63+ 9 . _ ** Code View** _ : Preview the code that will be output.
64+ 10 . _ ** Data View** _ : Preview the output that will be printed.
65+ 11 . _ ** Run** _ : Print and run the code.
8866