{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "
\n",
"
\n",
"
.append() and .concat().join() and .merge().merge_ordered()numpy, a powerful linear algebra library which helps keep things speedy.csv files we'll be importing\n",
"
\n",
"
df1: this is the first dataframe, and considered to be on the 'left' of df2df2: this is the second dataframe, considered to be on the right of df1how='left': this states the type of join; see the above SQL join tableleft_index=True: this uses the index of df1 as the join key for the left tableright_index=True: this uses the index of df2 as the join key for the right tablesuffixes: this places _df1 after column names which came from df1openprice and wkhigh dataframes together."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Note how our `Symbol` column isn't in the same order in each dataframe. This is intentional, and note that the dataframe on the left, `openprice` dictates the order of the dataframe on the right, `wkhigh`. Also note that the shared key between the two dataframes is exempt from having a suffix applied to it. "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n",
"merge the openprice and stockname dataframes and inspect the resultmerge all three dataframes together and inspect the result\n",
"
\n",
"
Production.Product.ProductID and Production.ProductSubcategory.ProductID keys, join the Production.Product and Production.ProductSubcategory tablesSales.SalesOrderHeader and Sales.SalesOrderDetail tablesSales.SalesOrderHeader, Sales.SalesOrderDetail, and Production.Product tables