Concatenation in pandas is the process of either adding rows to the end of an existing
DataFrame object or adding additional columns to a
DataFrame. In pandas, concatenation is performed via the pandas function
pd.concat(). The function will perform the operation on a specific axis and as we will see, will also perform any required set logic involved in aligning along that axis.
The general syntax to concatenate data is to pass a list of objects to
pd.concat(). The following performs a concatenation of two
In : # two Series objects to concatenate s1 = pd.Series(np.arange(0, 3)) s2 = pd.Series(np.arange(5, 8)) s1 Out: 0 0 1 1 2 2 dtype: int64 In : s2 Out: 0 5 1 6 2 7 dtype: int64 ...