Pandas > Inner/outer dataframes merge

Name
Code
Output
dataframe1 = pandas.DataFrame(numpy.random.randint(0,4,size=(3, 2)), columns=['C1','C2'])
dataframe2 = pandas.DataFrame(numpy.random.randint(0,4,size=(3, 2)), columns=['C1','C2'])
print ("dataframe1")
print (dataframe1)
print ("dataframe2")
print (dataframe2)
dataframe3 = pandas.merge(dataframe1, dataframe2, on='C1', how='inner')
print ("inner merged dataframes")
print (dataframe3)
dataframe4 = pandas.merge(dataframe1, dataframe2, on='C1', how='outer')
print ("outer merged dataframes")
print (dataframe4)
dataframe1
   C1  C2
0   3   3
1   0   1
2   1   3
dataframe2
   C1  C2
0   3   2
1   3   0
2   3   3
inner merged dataframes
   C1  C2_x  C2_y
0   3     3     2
1   3     3     0
2   3     3     3
outer merged dataframes
   C1  C2_x  C2_y
0   3     3   2.0
1   3     3   0.0
2   3     3   3.0
3   0     1   NaN
4   1     3   NaN