{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Intake für die Datenwissenschaften\n", "\n", "Intake erleichtert das Laden vieler verschiedener Formate und Typen. Um einen vollständigen Überblick zu erhalten, schaut euch das [Plugin Directory](https://intake.readthedocs.io/en/latest/plugin-directory.html) und das [Intake Project Dashboard](https://intake.github.io/status/) an. Intake überführt die Daten dann in übliche Speicherformate wie Pandas DataFrames, Numpy-Arrays oder Python-Listen. Anschließend sind sie leicht durchsuchbar und auch für verteilte Systeme zugänglich. Sollte euch ein Plugin fehlen, könnt ihr auch selbst welche estellen, wie in [Making Drivers](https://intake.readthedocs.io/en/latest/making-plugins.html) beschrieben." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Laden einer Datenquelle\n", "\n", "Im Folgenden werden wir zwei csv-Datensätze lesen und in einen Intake-Katalog überführen. " ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "execution": { "iopub.execute_input": "2026-05-22T12:15:37.778250Z", "iopub.status.busy": "2026-05-22T12:15:37.778083Z", "iopub.status.idle": "2026-05-22T12:15:38.997719Z", "shell.execute_reply": "2026-05-22T12:15:38.997288Z", "shell.execute_reply.started": "2026-05-22T12:15:37.778232Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "sources:\n", " csv:\n", " args:\n", " urlpath: states_*.csv\n", " description: ''\n", " driver: intake.source.csv.CSVSource\n", " metadata: {}\n", "\n" ] } ], "source": [ "import intake\n", "\n", "\n", "ds = intake.open_csv(\"states_*.csv\")\n", "\n", "print(ds)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Mit der `open_*`-Funktion von Intake lassen sich verschiedenen Datenquellen einlesen. Je nach Datenformat oder Dienst lassen sich unterschiedliche Argmuente verwenden." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Konfigurieren des Suchpfades für Datenquellen\n", "\n", "Intake überprüft die Intake-Konfigurationsdatei nach `catalog_pat`und die Umgebungsvariable `\"INTAKE_PATH\"` auf eine durch Doppelpunkte getrennte Liste von Pfaden bzw. Semikolon in Windows, um nach Katalogdateien zu suchen. Beim Import `intake` werden alle Einträge aus allen Katalogen angezeigt, auf die als Teil eines globalen Katalogs von `intake.cat` referenziert werden." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Daten lesen\n", "\n", "Intake liest Daten in Container verschiedener Formate:\n", "\n", "* Tabellen in Pandas DataFrames\n", "* Mehrdimensionale Array in Numpy Arrays\n", "* Semistrukturierte Daten in Python-Listen von Objekten, üblicherweise Dictionaries\n", "\n", "Um herauszufinden, in welchem Containerformat Intake die Daten vorhält, könnt ihr das `container`-Attribut verwenden:" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "execution": { "iopub.execute_input": "2026-05-22T12:15:38.998565Z", "iopub.status.busy": "2026-05-22T12:15:38.998335Z", "iopub.status.idle": "2026-05-22T12:15:39.002087Z", "shell.execute_reply": "2026-05-22T12:15:39.001775Z", "shell.execute_reply.started": "2026-05-22T12:15:38.998546Z" } }, "outputs": [ { "data": { "text/plain": [ "'dataframe'" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ds.container" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Neben `dataframe` kann das Ergebnis auch `ndarray` oder `python` sein." ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "execution": { "iopub.execute_input": "2026-05-22T12:15:39.002563Z", "iopub.status.busy": "2026-05-22T12:15:39.002449Z", "iopub.status.idle": "2026-05-22T12:15:39.012044Z", "shell.execute_reply": "2026-05-22T12:15:39.011774Z", "shell.execute_reply.started": "2026-05-22T12:15:39.002553Z" }, "scrolled": true }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
stateslugcodenicknamewebsiteadmission_dateadmission_numbercapital_citycapital_urlpopulationpopulation_rankconstitution_urlstate_flag_urlstate_seal_urlmap_image_urllandscape_background_urlskyline_background_urltwitter_urlfacebook_url
0AlabamaalabamaALYellowhammer Statehttp://www.alabama.gov1819-12-1422Montgomeryhttp://www.montgomeryal.gov483372223http://alisondb.legislature.state.al.us/alison...https://cdn.civil.services/us-states/flags/ala...https://cdn.civil.services/us-states/seals/ala...https://cdn.civil.services/us-states/maps/alab...https://cdn.civil.services/us-states/backgroun...https://cdn.civil.services/us-states/backgroun...https://twitter.com/alabamagovhttps://www.facebook.com/alabamagov
1AlaskaalaskaAKThe Last Frontierhttp://alaska.gov1959-01-0349Juneauhttp://www.juneau.org73513247http://www.legis.state.ak.us/basis/folioproxy....https://cdn.civil.services/us-states/flags/ala...https://cdn.civil.services/us-states/seals/ala...https://cdn.civil.services/us-states/maps/alas...https://cdn.civil.services/us-states/backgroun...https://cdn.civil.services/us-states/backgroun...https://twitter.com/alaskahttps://www.facebook.com/AlaskaLocalGovernments
2ArizonaarizonaAZThe Grand Canyon Statehttps://az.gov1912-02-1448Phoenixhttps://www.phoenix.gov662662415http://www.azleg.gov/Constitution.asphttps://cdn.civil.services/us-states/flags/ari...https://cdn.civil.services/us-states/seals/ari...https://cdn.civil.services/us-states/maps/ariz...https://cdn.civil.services/us-states/backgroun...https://cdn.civil.services/us-states/backgroun...NaNNaN
3ArkansasarkansasARThe Natural Statehttp://arkansas.gov1836-06-1525Little Rockhttp://www.littlerock.org295937332http://www.arkleg.state.ar.us/assembly/Summary...https://cdn.civil.services/us-states/flags/ark...https://cdn.civil.services/us-states/seals/ark...https://cdn.civil.services/us-states/maps/arka...https://cdn.civil.services/us-states/backgroun...https://cdn.civil.services/us-states/backgroun...https://twitter.com/arkansasgovhttps://www.facebook.com/Arkansas.gov
4CaliforniacaliforniaCAGolden Statehttp://www.ca.gov1850-09-0931Sacramentohttp://www.cityofsacramento.org383325211http://www.leginfo.ca.gov/const-toc.htmlhttps://cdn.civil.services/us-states/flags/cal...https://cdn.civil.services/us-states/seals/cal...https://cdn.civil.services/us-states/maps/cali...https://cdn.civil.services/us-states/backgroun...https://cdn.civil.services/us-states/backgroun...https://twitter.com/cagovernmentNaN
\n", "
" ], "text/plain": [ " state slug code nickname \\\n", "0 Alabama alabama AL Yellowhammer State \n", "1 Alaska alaska AK The Last Frontier \n", "2 Arizona arizona AZ The Grand Canyon State \n", "3 Arkansas arkansas AR The Natural State \n", "4 California california CA Golden State \n", "\n", " website admission_date admission_number capital_city \\\n", "0 http://www.alabama.gov 1819-12-14 22 Montgomery \n", "1 http://alaska.gov 1959-01-03 49 Juneau \n", "2 https://az.gov 1912-02-14 48 Phoenix \n", "3 http://arkansas.gov 1836-06-15 25 Little Rock \n", "4 http://www.ca.gov 1850-09-09 31 Sacramento \n", "\n", " capital_url population population_rank \\\n", "0 http://www.montgomeryal.gov 4833722 23 \n", "1 http://www.juneau.org 735132 47 \n", "2 https://www.phoenix.gov 6626624 15 \n", "3 http://www.littlerock.org 2959373 32 \n", "4 http://www.cityofsacramento.org 38332521 1 \n", "\n", " constitution_url \\\n", "0 http://alisondb.legislature.state.al.us/alison... \n", "1 http://www.legis.state.ak.us/basis/folioproxy.... \n", "2 http://www.azleg.gov/Constitution.asp \n", "3 http://www.arkleg.state.ar.us/assembly/Summary... \n", "4 http://www.leginfo.ca.gov/const-toc.html \n", "\n", " state_flag_url \\\n", "0 https://cdn.civil.services/us-states/flags/ala... \n", "1 https://cdn.civil.services/us-states/flags/ala... \n", "2 https://cdn.civil.services/us-states/flags/ari... \n", "3 https://cdn.civil.services/us-states/flags/ark... \n", "4 https://cdn.civil.services/us-states/flags/cal... \n", "\n", " state_seal_url \\\n", "0 https://cdn.civil.services/us-states/seals/ala... \n", "1 https://cdn.civil.services/us-states/seals/ala... \n", "2 https://cdn.civil.services/us-states/seals/ari... \n", "3 https://cdn.civil.services/us-states/seals/ark... \n", "4 https://cdn.civil.services/us-states/seals/cal... \n", "\n", " map_image_url \\\n", "0 https://cdn.civil.services/us-states/maps/alab... \n", "1 https://cdn.civil.services/us-states/maps/alas... \n", "2 https://cdn.civil.services/us-states/maps/ariz... \n", "3 https://cdn.civil.services/us-states/maps/arka... \n", "4 https://cdn.civil.services/us-states/maps/cali... \n", "\n", " landscape_background_url \\\n", "0 https://cdn.civil.services/us-states/backgroun... \n", "1 https://cdn.civil.services/us-states/backgroun... \n", "2 https://cdn.civil.services/us-states/backgroun... \n", "3 https://cdn.civil.services/us-states/backgroun... \n", "4 https://cdn.civil.services/us-states/backgroun... \n", "\n", " skyline_background_url \\\n", "0 https://cdn.civil.services/us-states/backgroun... \n", "1 https://cdn.civil.services/us-states/backgroun... \n", "2 https://cdn.civil.services/us-states/backgroun... \n", "3 https://cdn.civil.services/us-states/backgroun... \n", "4 https://cdn.civil.services/us-states/backgroun... \n", "\n", " twitter_url \\\n", "0 https://twitter.com/alabamagov \n", "1 https://twitter.com/alaska \n", "2 NaN \n", "3 https://twitter.com/arkansasgov \n", "4 https://twitter.com/cagovernment \n", "\n", " facebook_url \n", "0 https://www.facebook.com/alabamagov \n", "1 https://www.facebook.com/AlaskaLocalGovernments \n", "2 NaN \n", "3 https://www.facebook.com/Arkansas.gov \n", "4 NaN " ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df = ds.read()\n", "\n", "df.head()" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "execution": { "iopub.execute_input": "2026-05-22T12:15:39.012561Z", "iopub.status.busy": "2026-05-22T12:15:39.012439Z", "iopub.status.idle": "2026-05-22T12:15:39.014184Z", "shell.execute_reply": "2026-05-22T12:15:39.013815Z", "shell.execute_reply.started": "2026-05-22T12:15:39.012551Z" } }, "outputs": [], "source": [ "for chunk in ds.read_chunked():\n", " print(f\"Chunk: {len(chunk)}\")" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "execution": { "iopub.execute_input": "2026-05-22T12:15:39.014818Z", "iopub.status.busy": "2026-05-22T12:15:39.014624Z", "iopub.status.idle": "2026-05-22T12:15:39.431652Z", "shell.execute_reply": "2026-05-22T12:15:39.431243Z", "shell.execute_reply.started": "2026-05-22T12:15:39.014730Z" }, "scrolled": true }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
stateslugcodenicknamewebsiteadmission_dateadmission_numbercapital_citycapital_urlpopulationpopulation_rankconstitution_urlstate_flag_urlstate_seal_urlmap_image_urllandscape_background_urlskyline_background_urltwitter_urlfacebook_url
0AlabamaalabamaALYellowhammer Statehttp://www.alabama.gov1819-12-1422Montgomeryhttp://www.montgomeryal.gov483372223http://alisondb.legislature.state.al.us/alison...https://cdn.civil.services/us-states/flags/ala...https://cdn.civil.services/us-states/seals/ala...https://cdn.civil.services/us-states/maps/alab...https://cdn.civil.services/us-states/backgroun...https://cdn.civil.services/us-states/backgroun...https://twitter.com/alabamagovhttps://www.facebook.com/alabamagov
1AlaskaalaskaAKThe Last Frontierhttp://alaska.gov1959-01-0349Juneauhttp://www.juneau.org73513247http://www.legis.state.ak.us/basis/folioproxy....https://cdn.civil.services/us-states/flags/ala...https://cdn.civil.services/us-states/seals/ala...https://cdn.civil.services/us-states/maps/alas...https://cdn.civil.services/us-states/backgroun...https://cdn.civil.services/us-states/backgroun...https://twitter.com/alaskahttps://www.facebook.com/AlaskaLocalGovernments
2ArizonaarizonaAZThe Grand Canyon Statehttps://az.gov1912-02-1448Phoenixhttps://www.phoenix.gov662662415http://www.azleg.gov/Constitution.asphttps://cdn.civil.services/us-states/flags/ari...https://cdn.civil.services/us-states/seals/ari...https://cdn.civil.services/us-states/maps/ariz...https://cdn.civil.services/us-states/backgroun...https://cdn.civil.services/us-states/backgroun...NaNNaN
3ArkansasarkansasARThe Natural Statehttp://arkansas.gov1836-06-1525Little Rockhttp://www.littlerock.org295937332http://www.arkleg.state.ar.us/assembly/Summary...https://cdn.civil.services/us-states/flags/ark...https://cdn.civil.services/us-states/seals/ark...https://cdn.civil.services/us-states/maps/arka...https://cdn.civil.services/us-states/backgroun...https://cdn.civil.services/us-states/backgroun...https://twitter.com/arkansasgovhttps://www.facebook.com/Arkansas.gov
4CaliforniacaliforniaCAGolden Statehttp://www.ca.gov1850-09-0931Sacramentohttp://www.cityofsacramento.org383325211http://www.leginfo.ca.gov/const-toc.htmlhttps://cdn.civil.services/us-states/flags/cal...https://cdn.civil.services/us-states/seals/cal...https://cdn.civil.services/us-states/maps/cali...https://cdn.civil.services/us-states/backgroun...https://cdn.civil.services/us-states/backgroun...https://twitter.com/cagovernmentNaN
\n", "
" ], "text/plain": [ " state slug code nickname \\\n", "0 Alabama alabama AL Yellowhammer State \n", "1 Alaska alaska AK The Last Frontier \n", "2 Arizona arizona AZ The Grand Canyon State \n", "3 Arkansas arkansas AR The Natural State \n", "4 California california CA Golden State \n", "\n", " website admission_date admission_number capital_city \\\n", "0 http://www.alabama.gov 1819-12-14 22 Montgomery \n", "1 http://alaska.gov 1959-01-03 49 Juneau \n", "2 https://az.gov 1912-02-14 48 Phoenix \n", "3 http://arkansas.gov 1836-06-15 25 Little Rock \n", "4 http://www.ca.gov 1850-09-09 31 Sacramento \n", "\n", " capital_url population population_rank \\\n", "0 http://www.montgomeryal.gov 4833722 23 \n", "1 http://www.juneau.org 735132 47 \n", "2 https://www.phoenix.gov 6626624 15 \n", "3 http://www.littlerock.org 2959373 32 \n", "4 http://www.cityofsacramento.org 38332521 1 \n", "\n", " constitution_url \\\n", "0 http://alisondb.legislature.state.al.us/alison... \n", "1 http://www.legis.state.ak.us/basis/folioproxy.... \n", "2 http://www.azleg.gov/Constitution.asp \n", "3 http://www.arkleg.state.ar.us/assembly/Summary... \n", "4 http://www.leginfo.ca.gov/const-toc.html \n", "\n", " state_flag_url \\\n", "0 https://cdn.civil.services/us-states/flags/ala... \n", "1 https://cdn.civil.services/us-states/flags/ala... \n", "2 https://cdn.civil.services/us-states/flags/ari... \n", "3 https://cdn.civil.services/us-states/flags/ark... \n", "4 https://cdn.civil.services/us-states/flags/cal... \n", "\n", " state_seal_url \\\n", "0 https://cdn.civil.services/us-states/seals/ala... \n", "1 https://cdn.civil.services/us-states/seals/ala... \n", "2 https://cdn.civil.services/us-states/seals/ari... \n", "3 https://cdn.civil.services/us-states/seals/ark... \n", "4 https://cdn.civil.services/us-states/seals/cal... \n", "\n", " map_image_url \\\n", "0 https://cdn.civil.services/us-states/maps/alab... \n", "1 https://cdn.civil.services/us-states/maps/alas... \n", "2 https://cdn.civil.services/us-states/maps/ariz... \n", "3 https://cdn.civil.services/us-states/maps/arka... \n", "4 https://cdn.civil.services/us-states/maps/cali... \n", "\n", " landscape_background_url \\\n", "0 https://cdn.civil.services/us-states/backgroun... \n", "1 https://cdn.civil.services/us-states/backgroun... \n", "2 https://cdn.civil.services/us-states/backgroun... \n", "3 https://cdn.civil.services/us-states/backgroun... \n", "4 https://cdn.civil.services/us-states/backgroun... \n", "\n", " skyline_background_url \\\n", "0 https://cdn.civil.services/us-states/backgroun... \n", "1 https://cdn.civil.services/us-states/backgroun... \n", "2 https://cdn.civil.services/us-states/backgroun... \n", "3 https://cdn.civil.services/us-states/backgroun... \n", "4 https://cdn.civil.services/us-states/backgroun... \n", "\n", " twitter_url \\\n", "0 https://twitter.com/alabamagov \n", "1 https://twitter.com/alaska \n", "2 NaN \n", "3 https://twitter.com/arkansasgov \n", "4 https://twitter.com/cagovernment \n", "\n", " facebook_url \n", "0 https://www.facebook.com/alabamagov \n", "1 https://www.facebook.com/AlaskaLocalGovernments \n", "2 NaN \n", "3 https://www.facebook.com/Arkansas.gov \n", "4 NaN " ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ddf = ds.to_dask()\n", "\n", "ddf.head()" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "execution": { "iopub.execute_input": "2026-05-22T12:15:39.433296Z", "iopub.status.busy": "2026-05-22T12:15:39.433159Z", "iopub.status.idle": "2026-05-22T12:15:39.435795Z", "shell.execute_reply": "2026-05-22T12:15:39.435500Z", "shell.execute_reply.started": "2026-05-22T12:15:39.433286Z" } }, "outputs": [], "source": [ "cat = intake.open_catalog(\"us_states.yml\")" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "execution": { "iopub.execute_input": "2026-05-22T12:15:39.436147Z", "iopub.status.busy": "2026-05-22T12:15:39.436073Z", "iopub.status.idle": "2026-05-22T12:15:39.438418Z", "shell.execute_reply": "2026-05-22T12:15:39.438139Z", "shell.execute_reply.started": "2026-05-22T12:15:39.436140Z" } }, "outputs": [ { "data": { "text/plain": [ "['states']" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "list(cat)" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "execution": { "iopub.execute_input": "2026-05-22T12:15:39.438923Z", "iopub.status.busy": "2026-05-22T12:15:39.438844Z", "iopub.status.idle": "2026-05-22T12:15:39.516935Z", "shell.execute_reply": "2026-05-22T12:15:39.516633Z", "shell.execute_reply.started": "2026-05-22T12:15:39.438916Z" } }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
stateslug
0Alabamaalabama
1Alaskaalaska
2Arizonaarizona
3Arkansasarkansas
4Californiacalifornia
\n", "
" ], "text/plain": [ " state slug\n", "0 Alabama alabama\n", "1 Alaska alaska\n", "2 Arizona arizona\n", "3 Arkansas arkansas\n", "4 California california" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "cat.states.to_dask()[[\"state\", \"slug\"]].head()" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "execution": { "iopub.execute_input": "2026-05-22T12:15:39.517537Z", "iopub.status.busy": "2026-05-22T12:15:39.517441Z", "iopub.status.idle": "2026-05-22T12:15:39.526754Z", "shell.execute_reply": "2026-05-22T12:15:39.526499Z", "shell.execute_reply.started": "2026-05-22T12:15:39.517528Z" }, "scrolled": true }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
0123456789101112131415161718
0AlabamaalabamaALYellowhammer Statehttp://www.alabama.gov1819-12-1422Montgomeryhttp://www.montgomeryal.gov483372223http://alisondb.legislature.state.al.us/alison...https://cdn.civil.services/us-states/flags/ala...https://cdn.civil.services/us-states/seals/ala...https://cdn.civil.services/us-states/maps/alab...https://cdn.civil.services/us-states/backgroun...https://cdn.civil.services/us-states/backgroun...https://twitter.com/alabamagovhttps://www.facebook.com/alabamagov
1AlaskaalaskaAKThe Last Frontierhttp://alaska.gov1959-01-0349Juneauhttp://www.juneau.org73513247http://www.legis.state.ak.us/basis/folioproxy....https://cdn.civil.services/us-states/flags/ala...https://cdn.civil.services/us-states/seals/ala...https://cdn.civil.services/us-states/maps/alas...https://cdn.civil.services/us-states/backgroun...https://cdn.civil.services/us-states/backgroun...https://twitter.com/alaskahttps://www.facebook.com/AlaskaLocalGovernments
2ArizonaarizonaAZThe Grand Canyon Statehttps://az.gov1912-02-1448Phoenixhttps://www.phoenix.gov662662415http://www.azleg.gov/Constitution.asphttps://cdn.civil.services/us-states/flags/ari...https://cdn.civil.services/us-states/seals/ari...https://cdn.civil.services/us-states/maps/ariz...https://cdn.civil.services/us-states/backgroun...https://cdn.civil.services/us-states/backgroun...NaNNaN
3ArkansasarkansasARThe Natural Statehttp://arkansas.gov1836-06-1525Little Rockhttp://www.littlerock.org295937332http://www.arkleg.state.ar.us/assembly/Summary...https://cdn.civil.services/us-states/flags/ark...https://cdn.civil.services/us-states/seals/ark...https://cdn.civil.services/us-states/maps/arka...https://cdn.civil.services/us-states/backgroun...https://cdn.civil.services/us-states/backgroun...https://twitter.com/arkansasgovhttps://www.facebook.com/Arkansas.gov
4CaliforniacaliforniaCAGolden Statehttp://www.ca.gov1850-09-0931Sacramentohttp://www.cityofsacramento.org383325211http://www.leginfo.ca.gov/const-toc.htmlhttps://cdn.civil.services/us-states/flags/cal...https://cdn.civil.services/us-states/seals/cal...https://cdn.civil.services/us-states/maps/cali...https://cdn.civil.services/us-states/backgroun...https://cdn.civil.services/us-states/backgroun...https://twitter.com/cagovernmentNaN
\n", "
" ], "text/plain": [ " 0 1 2 3 4 \\\n", "0 Alabama alabama AL Yellowhammer State http://www.alabama.gov \n", "1 Alaska alaska AK The Last Frontier http://alaska.gov \n", "2 Arizona arizona AZ The Grand Canyon State https://az.gov \n", "3 Arkansas arkansas AR The Natural State http://arkansas.gov \n", "4 California california CA Golden State http://www.ca.gov \n", "\n", " 5 6 7 8 9 10 \\\n", "0 1819-12-14 22 Montgomery http://www.montgomeryal.gov 4833722 23 \n", "1 1959-01-03 49 Juneau http://www.juneau.org 735132 47 \n", "2 1912-02-14 48 Phoenix https://www.phoenix.gov 6626624 15 \n", "3 1836-06-15 25 Little Rock http://www.littlerock.org 2959373 32 \n", "4 1850-09-09 31 Sacramento http://www.cityofsacramento.org 38332521 1 \n", "\n", " 11 \\\n", "0 http://alisondb.legislature.state.al.us/alison... \n", "1 http://www.legis.state.ak.us/basis/folioproxy.... \n", "2 http://www.azleg.gov/Constitution.asp \n", "3 http://www.arkleg.state.ar.us/assembly/Summary... \n", "4 http://www.leginfo.ca.gov/const-toc.html \n", "\n", " 12 \\\n", "0 https://cdn.civil.services/us-states/flags/ala... \n", "1 https://cdn.civil.services/us-states/flags/ala... \n", "2 https://cdn.civil.services/us-states/flags/ari... \n", "3 https://cdn.civil.services/us-states/flags/ark... \n", "4 https://cdn.civil.services/us-states/flags/cal... \n", "\n", " 13 \\\n", "0 https://cdn.civil.services/us-states/seals/ala... \n", "1 https://cdn.civil.services/us-states/seals/ala... \n", "2 https://cdn.civil.services/us-states/seals/ari... \n", "3 https://cdn.civil.services/us-states/seals/ark... \n", "4 https://cdn.civil.services/us-states/seals/cal... \n", "\n", " 14 \\\n", "0 https://cdn.civil.services/us-states/maps/alab... \n", "1 https://cdn.civil.services/us-states/maps/alas... \n", "2 https://cdn.civil.services/us-states/maps/ariz... \n", "3 https://cdn.civil.services/us-states/maps/arka... \n", "4 https://cdn.civil.services/us-states/maps/cali... \n", "\n", " 15 \\\n", "0 https://cdn.civil.services/us-states/backgroun... \n", "1 https://cdn.civil.services/us-states/backgroun... \n", "2 https://cdn.civil.services/us-states/backgroun... \n", "3 https://cdn.civil.services/us-states/backgroun... \n", "4 https://cdn.civil.services/us-states/backgroun... \n", "\n", " 16 \\\n", "0 https://cdn.civil.services/us-states/backgroun... \n", "1 https://cdn.civil.services/us-states/backgroun... \n", "2 https://cdn.civil.services/us-states/backgroun... \n", "3 https://cdn.civil.services/us-states/backgroun... \n", "4 https://cdn.civil.services/us-states/backgroun... \n", "\n", " 17 \\\n", "0 https://twitter.com/alabamagov \n", "1 https://twitter.com/alaska \n", "2 NaN \n", "3 https://twitter.com/arkansasgov \n", "4 https://twitter.com/cagovernment \n", "\n", " 18 \n", "0 https://www.facebook.com/alabamagov \n", "1 https://www.facebook.com/AlaskaLocalGovernments \n", "2 NaN \n", "3 https://www.facebook.com/Arkansas.gov \n", "4 NaN " ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "cat.states(csv_kwargs={\"header\": None, \"skiprows\": 1}).read().head()" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3.13 Kernel", "language": "python", "name": "python313" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.13.0" }, "latex_envs": { "LaTeX_envs_menu_present": true, "autoclose": false, "autocomplete": true, "bibliofile": "biblio.bib", "cite_by": "apalike", "current_citInitial": 1, "eqLabelWithNumbers": true, "eqNumInitial": 1, "hotkeys": { "equation": "Ctrl-E", "itemize": "Ctrl-I" }, "labels_anchors": false, "latex_user_defs": false, "report_style_numbering": false, "user_envs_cfg": false }, "widgets": { "application/vnd.jupyter.widget-state+json": { "state": {}, "version_major": 2, "version_minor": 0 } } }, "nbformat": 4, "nbformat_minor": 4 }