import pandas as pd # create two series s1 = pd.Series([1, 2, 3]) s2 = pd.Series([4, 5, 6]) # append the two series s3 = s1.append(s2) print(s3)
0 1 1 2 2 3 0 4 1 5 2 6 dtype: int64
import pandas as pd # create three series s1 = pd.Series([1, 2, 3]) s2 = pd.Series([4, 5, 6]) s3 = pd.Series([7, 8, 9]) # append the three series s4 = s1.append([s2, s3]) print(s4)
0 1 1 2 2 3 0 4 1 5 2 6 0 7 1 8 2 9 dtype: int64In the first example, two series are created and then appended together using the Series _append method. The resulting series is printed to the console. In the second example, three series are created and then appended together using the Series _append method with a list of series as the argument. The resulting series is printed to the console. The package library being used is the python pandas library.