Hoppa över navigering

US Labor Force Statistics

labor statistics force

Arbetskraftsstatistik för arbetskraft, arbetskraftsdeltagande och civil icke-institutionell befolkning efter ålder, kön, ras och etniska grupper. i USA.

Denna datamängd hämtas från Current Employment Statistics - CES (National) data som publiceras av US Bureau of Labor Statistics (BLS). I Linking and Copyright Information och Important Web Site Notices finns villkor och bestämmelser för användningen av denna datamängd.

Lagringsplats

Datamängden lagras i Azure-regionen Östra USA. Vi rekommenderar att beräkningsresurser tilldelas i Östra USA av tillhörighetsskäl.

Relaterade datamängder

Meddelanden

MICROSOFT TILLHANDAHÅLLER AZURE OPEN DATASETS I BEFINTLIGT SKICK. MICROSOFT UTFÄRDAR INTE NÅGRA GARANTIER ELLER VILLKOR, UTTRYCKLIGA ELLER UNDERFÖRSTÅDDA, AVSEENDE ANVÄNDNINGEN AV DATAMÄNGDERNA. I DEN UTSTRÄCKNING DET ÄR TILLÅTET ENLIGT NATIONELL LAGSTIFTNING, FRISKRIVER MICROSOFT SIG FRÅN ALLT ANSVAR BETRÄFFANDE SKADOR OCH FÖRLUSTER, INKLUSIVE DIREKTA SKADOR, FÖLJDSKADOR, SÄRSKILDA SKADOR, INDIREKTA SKADOR, ELLER OFÖRUTSEDDA SKADOR FRÅN ANVÄNDNINGEN AV DATAMÄNGDERNA.

Datamängden tillhandahålls enligt de ursprungliga villkor som gällde när Microsoft tog emot källdatan. Datamängden kan innehålla data från Microsoft.

Access

Available inWhen to use
Azure Notebooks

Quickly explore the dataset with Jupyter notebooks hosted on Azure or your local machine.

Azure Databricks

Use this when you need the scale of an Azure managed Spark cluster to process the dataset.

Azure Synapse

Use this when you need the scale of an Azure managed Spark cluster to process the dataset.

Preview

series_id year period value footnote_codes lfst_code periodicity_code series_title absn_code activity_code ages_code cert_code class_code duration_code education_code entr_code expr_code hheader_code hour_code indy_code jdes_code look_code mari_code mjhs_code occupation_code orig_code pcts_code race_code rjnw_code rnlf_code rwns_code seek_code sexs_code tdat_code vets_code wkst_code born_code chld_code disa_code seasonal
LNS11000031Q 1972 Q01 4300 nan 10 Q (Seas) Civilian Labor Force Level - 20 yrs. & over, Black or African American Men 0 0 17 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 1 0 0 0 0 0 0 S
LNS11000031Q 1972 Q02 4370 nan 10 Q (Seas) Civilian Labor Force Level - 20 yrs. & over, Black or African American Men 0 0 17 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 1 0 0 0 0 0 0 S
LNS11000031Q 1972 Q03 4397 nan 10 Q (Seas) Civilian Labor Force Level - 20 yrs. & over, Black or African American Men 0 0 17 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 1 0 0 0 0 0 0 S
LNS11000031Q 1972 Q04 4381 nan 10 Q (Seas) Civilian Labor Force Level - 20 yrs. & over, Black or African American Men 0 0 17 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 1 0 0 0 0 0 0 S
LNS11000031Q 1973 Q01 4408 nan 10 Q (Seas) Civilian Labor Force Level - 20 yrs. & over, Black or African American Men 0 0 17 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 1 0 0 0 0 0 0 S
LNS11000031Q 1973 Q02 4445 nan 10 Q (Seas) Civilian Labor Force Level - 20 yrs. & over, Black or African American Men 0 0 17 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 1 0 0 0 0 0 0 S
LNS11000031Q 1973 Q03 4477 nan 10 Q (Seas) Civilian Labor Force Level - 20 yrs. & over, Black or African American Men 0 0 17 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 1 0 0 0 0 0 0 S
LNS11000031Q 1973 Q04 4523 nan 10 Q (Seas) Civilian Labor Force Level - 20 yrs. & over, Black or African American Men 0 0 17 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 1 0 0 0 0 0 0 S
LNS11000031Q 1974 Q01 4574 nan 10 Q (Seas) Civilian Labor Force Level - 20 yrs. & over, Black or African American Men 0 0 17 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 1 0 0 0 0 0 0 S
LNS11000031Q 1974 Q02 4538 nan 10 Q (Seas) Civilian Labor Force Level - 20 yrs. & over, Black or African American Men 0 0 17 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 1 0 0 0 0 0 0 S
Name Data type Unique Values (sample) Description
absn_code int 4 3
4
activity_code int 7 8
3
ages_code int 35 10
17
born_code int 3 2
1
cert_code int 5 4
3
chld_code int 6 1
5
class_code int 14 2
1
disa_code int 3 2
1
duration_code int 11 18
6
education_code int 9 40
19
entr_code int 3 1
2
expr_code int 3 1
2
footnote_codes string 7 nan
4.0
hheader_code int 2 1
hour_code int 13 1
16
indy_code int 323 368
169
jdes_code int 3 1
2
lfst_code int 33 20
30
look_code int 7 1
6
mari_code int 5 2
1
mjhs_code int 6 1
4
occupation_code int 566 4999
8999
orig_code int 14 1
2
pcts_code int 23 5
8
period string 18 M07
M06
periodicity_code string 3 M
Q
race_code int 14 1
3
rjnw_code int 9 1
3
rnlf_code int 11 63
65
rwns_code int 17 10
1
seasonal string 2 U
S
seek_code int 2 1
series_id string 45,478 LNU02000000
LNU02034560
series_title string 34,264 (Unadj) Employment-Population Ratio
(Unadj) Unemployment Rate
sexs_code int 3 1
2
tdat_code int 6 1
4
value float 121,742 3.0
4.0
vets_code int 8 25
1
wkst_code int 7 1
4
year int 80 2018
2017

Select your preferred service:

Azure Notebooks

Azure Databricks

Azure Synapse

Azure Notebooks

Package: Language: Python Python
In [1]:
# This is a package in preview.
from azureml.opendatasets import UsLaborLFS

labor = UsLaborLFS()
labor_df = labor.to_pandas_dataframe()
ActivityStarted, to_pandas_dataframe
ActivityStarted, to_pandas_dataframe_in_worker
Looking for parquet files...
Reading them into Pandas dataframe...
Reading lfs/part-00000-tid-4718855758432152076-e1368493-3ca0-43f2-ad4b-05316649fd34-10220-1-c000.snappy.parquet under container laborstatisticscontainer
Done.
ActivityCompleted: Activity=to_pandas_dataframe_in_worker, HowEnded=Success, Duration=21041.0 [ms]
ActivityCompleted: Activity=to_pandas_dataframe, HowEnded=Success, Duration=21073.64 [ms]
In [2]:
labor_df.info()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 6560503 entries, 0 to 6560502
Data columns (total 40 columns):
series_id           object
year                int32
period              object
value               float32
footnote_codes      object
lfst_code           int32
periodicity_code    object
series_title        object
absn_code           int32
activity_code       int32
ages_code           int32
cert_code           int32
class_code          int32
duration_code       int32
education_code      int32
entr_code           int32
expr_code           int32
hheader_code        int32
hour_code           int32
indy_code           int32
jdes_code           int32
look_code           int32
mari_code           int32
mjhs_code           int32
occupation_code     int32
orig_code           int32
pcts_code           int32
race_code           int32
rjnw_code           int32
rnlf_code           int32
rwns_code           int32
seek_code           int32
sexs_code           int32
tdat_code           int32
vets_code           int32
wkst_code           int32
born_code           int32
chld_code           int32
disa_code           int32
seasonal            object
dtypes: float32(1), int32(33), object(6)
memory usage: 1.1+ GB
In [1]:
# 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
In [2]:
# Azure storage access info
azure_storage_account_name = "azureopendatastorage"
azure_storage_sas_token = r""
container_name = "laborstatisticscontainer"
folder_name = "lfs/"
In [3]:
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)
In [4]:
# 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)
In [5]:
# you can add your filter at below
print('Loaded as a Pandas data frame: ')
df
In [6]:
 

Azure Databricks

Package: Language: Python Python
In [1]:
# This is a package in preview.
from azureml.opendatasets import UsLaborLFS

labor = UsLaborLFS()
labor_df = labor.to_spark_dataframe()
ActivityStarted, to_spark_dataframe ActivityStarted, to_spark_dataframe_in_worker ActivityCompleted: Activity=to_spark_dataframe_in_worker, HowEnded=Success, Duration=2504.76 [ms] ActivityCompleted: Activity=to_spark_dataframe, HowEnded=Success, Duration=2506.26 [ms]
In [2]:
display(labor_df.limit(5))
series_idyearperiodvaluefootnote_codeslfst_codeperiodicity_codeseries_titleabsn_codeactivity_codeages_codecert_codeclass_codeduration_codeeducation_codeentr_codeexpr_codehheader_codehour_codeindy_codejdes_codelook_codemari_codemjhs_codeoccupation_codeorig_codepcts_coderace_coderjnw_codernlf_coderwns_codeseek_codesexs_codetdat_codevets_codewkst_codeborn_codechld_codedisa_codeseasonal
LNS11300018 1972M0139.2nan13M(Seas) Labor Force Participation Rate - 16-19 yrs., Black or African American0080000000000000000300000100000S
LNS11300018 1972M0239.7nan13M(Seas) Labor Force Participation Rate - 16-19 yrs., Black or African American0080000000000000000300000100000S
LNS11300018 1972M0339.6nan13M(Seas) Labor Force Participation Rate - 16-19 yrs., Black or African American0080000000000000000300000100000S
LNS11300018 1972M0438.6nan13M(Seas) Labor Force Participation Rate - 16-19 yrs., Black or African American0080000000000000000300000100000S
LNS11300018 1972M0538.1nan13M(Seas) Labor Force Participation Rate - 16-19 yrs., Black or African American0080000000000000000300000100000S
In [1]:
# Azure storage access info
blob_account_name = "azureopendatastorage"
blob_container_name = "laborstatisticscontainer"
blob_relative_path = "lfs/"
blob_sas_token = r""
In [2]:
# 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)
In [3]:
# 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')
In [4]:
# Display top 10 rows
print('Displaying top 10 rows: ')
display(spark.sql('SELECT * FROM source LIMIT 10'))

Azure Synapse

Package: Language: Python
In [1]:
# Azure storage access info
blob_account_name = "azureopendatastorage"
blob_container_name = "laborstatisticscontainer"
blob_relative_path = "lfs/"
blob_sas_token = r""
In [2]:
# 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)
In [3]:
# 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')
In [4]:
# Display top 10 rows
print('Displaying top 10 rows: ')
display(spark.sql('SELECT * FROM source LIMIT 10'))