{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "nbgrader": { "grade": false, "grade_id": "cell-4591728b0e94385d", "locked": true, "schema_version": 3, "solution": false, "task": false } }, "outputs": [], "source": [ "# You must run this cell, but you can ignore its contents.\n", "\n", "import hashlib\n", "\n", "def ads_hash(ty):\n", " \"\"\"Return a unique string for input\"\"\"\n", " ty_str = str(ty).encode()\n", " m = hashlib.sha256()\n", " m.update(ty_str)\n", " return m.hexdigest()[:10]" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "nbgrader": { "grade": false, "grade_id": "cell-b2a0e9ec110c03e1", "locked": true, "schema_version": 3, "solution": false, "task": false } }, "outputs": [], "source": [ "import pandas as pd" ] }, { "cell_type": "markdown", "metadata": { "nbgrader": { "grade": false, "grade_id": "cell-bfeafe88c3a0be38", "locked": true, "schema_version": 3, "solution": false, "task": false } }, "source": [ "Let's get started by making a sample dataframe with fake data:" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "nbgrader": { "grade": false, "grade_id": "cell-710e679d69e83ae2", "locked": true, "schema_version": 3, "solution": false, "task": false } }, "outputs": [ { "data": { "text/html": [ "
\n", " | number | \n", "color | \n", "
---|---|---|
0 | \n", "1 | \n", "blue | \n", "
1 | \n", "2 | \n", "blue | \n", "
2 | \n", "3 | \n", "red | \n", "
3 | \n", "234 | \n", "red | \n", "
4 | \n", "2 | \n", "red | \n", "
5 | \n", "3 | \n", "blue | \n", "
6 | \n", "2 | \n", "blue | \n", "
7 | \n", "2 | \n", "red | \n", "
8 | \n", "1 | \n", "green | \n", "
9 | \n", "2 | \n", "yellow | \n", "
\n", " | bee | \n", "nest | \n", "treatment | \n", "tstartforaging | \n", "logtstartforaging | \n", "maxminusstarttime | \n", "sumfeedingtime | \n", "logsumfeedingtime | \n", "numberofvisitations | \n", "sumdistcovered | \n", "... | \n", "allcolorsvisited | \n", "averagedistance | \n", "meanspeed | \n", "sumflowersvisited | \n", "visitspatchA | \n", "visitspatchB | \n", "visitspatchC | \n", "patchesvisited | \n", "allpatchesvisited | \n", "visitsperpatchrounded | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "201531004 | \n", "3 | \n", "control | \n", "815 | \n", "2.911158 | \n", "1965.0 | \n", "80 | \n", "1.903090 | \n", "21 | \n", "1287.688282 | \n", "... | \n", "1 | \n", "80.480518 | \n", "2.767027 | \n", "12 | \n", "6 | \n", "13 | \n", "2 | \n", "3 | \n", "1 | \n", "7 | \n", "
1 | \n", "201531005 | \n", "3 | \n", "control | \n", "108 | \n", "2.033424 | \n", "NaN | \n", "1 | \n", "0.000000 | \n", "1 | \n", "NaN | \n", "... | \n", "0 | \n", "NaN | \n", "NaN | \n", "1 | \n", "1 | \n", "0 | \n", "0 | \n", "1 | \n", "0 | \n", "0 | \n", "
2 | \n", "201531006 | \n", "3 | \n", "control | \n", "90 | \n", "1.954243 | \n", "788.0 | \n", "136 | \n", "2.133539 | \n", "56 | \n", "2787.280939 | \n", "... | \n", "1 | \n", "60.593064 | \n", "4.572772 | \n", "21 | \n", "9 | \n", "25 | \n", "22 | \n", "3 | \n", "1 | \n", "19 | \n", "
3 | \n", "201531101 | \n", "3 | \n", "control | \n", "1 | \n", "0.000000 | \n", "320.0 | \n", "61 | \n", "1.785330 | \n", "16 | \n", "578.355534 | \n", "... | \n", "1 | \n", "72.294442 | \n", "3.651351 | \n", "7 | \n", "0 | \n", "15 | \n", "1 | \n", "2 | \n", "0 | \n", "5 | \n", "
4 | \n", "201531102 | \n", "3 | \n", "control | \n", "0 | \n", "0.000000 | \n", "656.0 | \n", "258 | \n", "2.411620 | \n", "49 | \n", "2845.622453 | \n", "... | \n", "1 | \n", "71.140561 | \n", "6.307130 | \n", "18 | \n", "4 | \n", "24 | \n", "21 | \n", "3 | \n", "1 | \n", "16 | \n", "
5 rows × 28 columns
\n", "