{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Problem 1\n", "Import NumPy under the alias `np`." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import numpy as np" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Problem 2\n", "Import pandas under the alias `pd`." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "import pandas as pd" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Problem 3\n", "Given the DataFrames `df` and `other_df`, perform a join operation that joins `other_df` onto `df`." ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "df = pd.DataFrame({'A': ['A0', 'A1', 'A2', 'A3', 'A4', 'A5']}, index = ['K0', 'K1', 'K2', 'K3', 'K4', 'K5'])" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "other_df = pd.DataFrame({'B': ['B0', 'B1', 'B2']}, index = ['K0', 'K1', 'K2'])" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | A | \n", "B | \n", "
---|---|---|
K0 | \n", "A0 | \n", "B0 | \n", "
K1 | \n", "A1 | \n", "B1 | \n", "
K2 | \n", "A2 | \n", "B2 | \n", "
K3 | \n", "A3 | \n", "NaN | \n", "
K4 | \n", "A4 | \n", "NaN | \n", "
K5 | \n", "A5 | \n", "NaN | \n", "