Lesson 5: working with tabular data (another name to distinguish from lesson 3)
Merge soda and inv tables, call it inv_soda.
Not all kinds of soda will appear in the invoice (as some were never sold). If we want to keep everything in the soda dataframe, what kind of join should we use?
Lesson 5: working with tabular data (another name to distinguish from lesson 3)
Merge soda and inv tables, call it inv_soda.
Not all kinds of soda will appear in the invoice (as some were never sold). If we want to keep everything in the soda dataframe, what kind of join should we use?
current answer:
inv_soda = inv.merge(soda, how="left", right_on="Item_id", left_on="Item_id")
Left join will leave you all invoices. Still won't have records about the soda never sold. Should be outer join.
inv_soda = inv.merge(soda, how="outer", right_on="Item_id", left_on="Item_id")