{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# 合并数据 & 分解多边形\n", "\n", "参考:[合并数据 & 分解多边形](https://pygis.io/docs/e_vector_merge_dissolve.html)\n", "\n", "数据帧在 Python 中被广泛用于操作数据。回想一下,数据帧本质上是 Excel 电子表格(一个行和列的 2-D 表);事实上,在使用 Python 中的数据帧时,您可能在 Excel 中使用的许多函数通常可以复制!\n", "\n", "本章将介绍一些可以对数据帧执行的基本运算。使用这些基本运算来计算和绘制弗吉尼亚州联邦的贫困率。从美国人口普查局 2019 年美国社区调查([ACS](https://www.census.gov/programs-surveys/acs))中提取[数据](https://www.census.gov/data/developers/data-sets/acs-5year.html)。" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", "import pandas as pd\n", "import geopandas as gpd\n", "from census import Census\n", "from us import states" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## 访问数据\n", "\n", "### 输入人口普查数据\n", "\n", "从访问和导入普查数据开始。将人口普查数据导入 Python 需要 [census API](http://api.census.gov/data/key_signup.html) 键。可从人口普查 API key 获取密钥。它将为您提供独特的 40 位文本字符串。请记下这个号码。把它存放在安全的地方。\n", "\n" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3.10.4 ('tvmx': conda)", "language": "python", "name": "python3" }, "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.10.4" }, "orig_nbformat": 4, "vscode": { "interpreter": { "hash": "e579259ee6098e2b9319de590d145b4b096774fe457bdf04260e3ba5c171e887" } } }, "nbformat": 4, "nbformat_minor": 2 }