2000 年と 2010 年に実施された 10 年ごとの国勢調査をソースとする、米国郵便番号ごとの性別および人種別の米国人口。
このデータセットは、米国国勢調査局の Decennial Census Dataset API から提供されます。 このデータセットの使用に関する諸条件については、「Terms of Service (サービス利用規約)」および「Policies and Notices (ポリシーと通知)」をご覧ください。
注
Microsoft は、Azure Open Datasets を "現状有姿" で提供します。 Microsoft は、データセットの使用に関して、明示または黙示を問わず、いかなる保証も行わないものとし、条件を定めることもありません。 現地の法律の下で認められている範囲内で、Microsoft は、データセットの使用に起因する、直接的、派生的、特別、間接的、偶発的、または懲罰的なものを含めたいかなる損害または損失に対しても一切の責任を負わないものとします。
このデータセットは、Microsoft がソース データを受け取った元の条件に基づいて提供されます。 データセットには、Microsoft が提供するデータが含まれている場合があります。
容量と保持期間
このデータセットは Parquet 形式で保存されており、2010 年のデータが含まれています。
保存先
このデータセットは、米国東部 Azure リージョンに保存されています。 アフィニティを考慮して、米国東部にコンピューティング リソースを割り当てることをお勧めします。
[列]
| Name |
データ型 |
一意の |
値(サンプル) |
説明 |
| decennialTime |
文字列 |
1 |
2010 |
10 年ごとの国勢調査が行われた時期 (例: 2010、2000)。 |
| maxAge |
INT |
23 |
54 21 |
年齢範囲の最大値。 null の場合、すべての年齢が対象となるか、年齢範囲に上限がなくなります (> 85 歳など)。 |
| minAge |
INT |
23 |
45 30 |
年齢範囲の最小値。 null の場合、すべての年齢にわたります。 |
| 母集団 |
INT |
29,274 |
1 2 |
このセグメントの人口。 |
| レース |
文字列 |
8 |
黒人やアフリカ系アメリカ人だけの他のレース |
国勢調査データの人種カテゴリ。 null の場合、すべての人種にわたります。 |
| 性別 |
文字列 |
3 |
女性男性 |
男性または女性。 null の場合、男女両方にわたります。 |
| 年 |
INT |
1 |
2010 |
10年単位の年(整数)。 |
| 郵便番号 |
文字列 |
33,120 |
39218 87420 |
5桁のZIPコード集計地域(ZCTA5)。 |
プレビュー
| decennialTime |
郵便番号 |
母集団 |
レース |
性別 |
minAge |
maxAge |
年 |
| 2010 |
77477 |
265 |
ホワイト アローン |
女性 |
15 |
17 |
2010 |
| 2010 |
77477 |
107 |
一部の他のレースのみ |
女性 |
15 |
17 |
2010 |
| 2010 |
77477 |
12 |
一部の他のレースのみ |
女性 |
65 |
66 |
2010 |
| 2010 |
77477 |
101 |
アジア人一人 |
女性 |
60 |
61 |
2010 |
| 2010 |
77477 |
221 |
アジア人一人 |
男性 |
10 |
14 |
2010 |
| 2010 |
77478 |
256 |
ホワイト アローン |
女性 |
15 |
17 |
2010 |
| 2010 |
77478 |
17 |
一部の他のレースのみ |
女性 |
15 |
17 |
2010 |
| 2010 |
77478 |
3 |
一部の他のレースのみ |
女性 |
65 |
66 |
2010 |
データ アクセス
Azure Notebooks
# This is a package in preview.
from azureml.opendatasets import UsPopulationZip
population = UsPopulationZip()
population_df = population.to_pandas_dataframe()
population_df.info()
# Pip install packages
import os, sys
!{sys.executable} -m pip install azure-storage-blob
!{sys.executable} -m pip install pyarrow
!{sys.executable} -m pip install pandas
# Azure storage access info
azure_storage_account_name = "azureopendatastorage"
azure_storage_sas_token = r""
container_name = "censusdatacontainer"
folder_name = "release/us_population_zip/"
from azure.storage.blob import BlockBlobServicefrom azure.storage.blob import BlobServiceClient, BlobClient, ContainerClient
if azure_storage_account_name is None or azure_storage_sas_token is None:
raise Exception(
"Provide your specific name and key for your Azure Storage account--see the Prerequisites section earlier.")
print('Looking for the first parquet under the folder ' +
folder_name + ' in container "' + container_name + '"...')
container_url = f"https://{azure_storage_account_name}.blob.core.windows.net/"
blob_service_client = BlobServiceClient(
container_url, azure_storage_sas_token if azure_storage_sas_token else None)
container_client = blob_service_client.get_container_client(container_name)
blobs = container_client.list_blobs(folder_name)
sorted_blobs = sorted(list(blobs), key=lambda e: e.name, reverse=True)
targetBlobName = ''
for blob in sorted_blobs:
if blob.name.startswith(folder_name) and blob.name.endswith('.parquet'):
targetBlobName = blob.name
break
print('Target blob to download: ' + targetBlobName)
_, filename = os.path.split(targetBlobName)
blob_client = container_client.get_blob_client(targetBlobName)
with open(filename, 'wb') as local_file:
blob_client.download_blob().download_to_stream(local_file)
# Read the parquet file into Pandas data frame
import pandas as pd
print('Reading the parquet file into Pandas data frame')
df = pd.read_parquet(filename)
# you can add your filter at below
print('Loaded as a Pandas data frame: ')
df
このプラットフォームとパッケージの組み合わせでは、サンプルは利用できません。
Azure Databricks
# This is a package in preview.
from azureml.opendatasets import UsPopulationZip
population = UsPopulationZip()
population_df = population.to_spark_dataframe()
display(population_df.limit(5))
このプラットフォームとパッケージの組み合わせでは、サンプルは利用できません。
# Azure storage access info
blob_account_name = "azureopendatastorage"
blob_container_name = "censusdatacontainer"
blob_relative_path = "release/us_population_zip/"
blob_sas_token = r""
# Allow SPARK to read from Blob remotely
wasbs_path = 'wasbs://%s@%s.blob.core.windows.net/%s' % (blob_container_name, blob_account_name, blob_relative_path)
spark.conf.set(
'fs.azure.sas.%s.%s.blob.core.windows.net' % (blob_container_name, blob_account_name),
blob_sas_token)
print('Remote blob path: ' + wasbs_path)
# SPARK read parquet, note that it won't load any data yet by now
df = spark.read.parquet(wasbs_path)
print('Register the DataFrame as a SQL temporary view: source')
df.createOrReplaceTempView('source')
# Display top 10 rows
print('Displaying top 10 rows: ')
display(spark.sql('SELECT * FROM source LIMIT 10'))
Azure Synapse
# This is a package in preview.
from azureml.opendatasets import UsPopulationZip
population = UsPopulationZip()
population_df = population.to_spark_dataframe()
# Display top 5 rows
display(population_df.limit(5))
このプラットフォームとパッケージの組み合わせでは、サンプルは利用できません。
# Azure storage access info
blob_account_name = "azureopendatastorage"
blob_container_name = "censusdatacontainer"
blob_relative_path = "release/us_population_zip/"
blob_sas_token = r""
# Allow SPARK to read from Blob remotely
wasbs_path = 'wasbs://%s@%s.blob.core.windows.net/%s' % (blob_container_name, blob_account_name, blob_relative_path)
spark.conf.set(
'fs.azure.sas.%s.%s.blob.core.windows.net' % (blob_container_name, blob_account_name),
blob_sas_token)
print('Remote blob path: ' + wasbs_path)
# SPARK read parquet, note that it won't load any data yet by now
df = spark.read.parquet(wasbs_path)
print('Register the DataFrame as a SQL temporary view: source')
df.createOrReplaceTempView('source')
# Display top 10 rows
print('Displaying top 10 rows: ')
display(spark.sql('SELECT * FROM source LIMIT 10'))
Azure SQL Database
Azure SQL Databaseは、データ仮想化を使用してこのデータセットに直接クエリを実行できます。
OPENROWSETを使用して、HTTPS 経由で Parquet ファイルを読み取ります。
その場でクエリ
SELECT TOP 100 *
FROM OPENROWSET(
BULK 'abs://censusdatacontainer@azureopendatastorage.blob.core.windows.net/release/us_population_zip/**',
FORMAT = 'PARQUET'
) AS [src];
テーブルに永続化する(任意)
SELECT *
INTO dbo.UsPopulationByZip_Local
FROM OPENROWSET(
BULK 'abs://censusdatacontainer@azureopendatastorage.blob.core.windows.net/release/us_population_zip/**',
FORMAT = 'PARQUET'
) AS [src];
次のステップ
Open Datasets カタログの残りのデータセットを表示します。