I am still new to pandas and have the following problem. I want to merge two tables together but they have different dimensions.
I have 2 data frames.
Date: Order Num.: More Stuff: Even more ...
01.01.2021 123 asdf ...
01.01.2021 124 fdsa ...
02.01.2021 127 foo ...
... ... ... ...
The second one contains more information on the Order Numbers and have additional shipping numbers.
Order No.: Shipping Num.:
123 111112
123 111113
123 111114
124 111171
124 ...
The result should be a left join on order number with the final table looking something like:
Date: Order Num.: Shipping Num.: More Stuff: Even more ...
01.01.2021 123 111112 asdf ...
01.01.2021 123 111113 asdf ...
01.01.2021 123 111114 asdf ...
02.01.2021 124 111171 fdsa ...
... ... ... ... ...
I tried using df_result = pd.merge(df1, df2, left_on='Order No.:', right_on='Order Num.:', how='left')
and a few variations of that but the extra columns get lost in the process. How do I go about this?