{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## Working With Image Data" ] }, { "cell_type": "code", "execution_count": 330, "metadata": {}, "outputs": [], "source": [ "from sklearn.datasets import load_digits\n", "import pandas as pd\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "%matplotlib inline\n", "\n", "digits_data = load_digits()" ] }, { "cell_type": "code", "execution_count": 331, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "dict_keys(['data', 'target', 'target_names', 'images', 'DESCR'])" ] }, "execution_count": 331, "metadata": {}, "output_type": "execute_result" } ], "source": [ "digits_data.keys()" ] }, { "cell_type": "code", "execution_count": 332, "metadata": {}, "outputs": [], "source": [ "labels = pd.Series(digits_data['target'])" ] }, { "cell_type": "code", "execution_count": 333, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | 0 | \n", "1 | \n", "2 | \n", "3 | \n", "4 | \n", "5 | \n", "6 | \n", "7 | \n", "8 | \n", "9 | \n", "... | \n", "54 | \n", "55 | \n", "56 | \n", "57 | \n", "58 | \n", "59 | \n", "60 | \n", "61 | \n", "62 | \n", "63 | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "0.0 | \n", "0.0 | \n", "5.0 | \n", "13.0 | \n", "9.0 | \n", "1.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "... | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "6.0 | \n", "13.0 | \n", "10.0 | \n", "0.0 | \n", "0.0 | \n", "0.0 | \n", "
1 rows × 64 columns
\n", "