The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
Error code: DatasetGenerationCastError
Exception: DatasetGenerationCastError
Message: An error occurred while generating the dataset
All the data files must have the same columns, but at some point there are 31 new columns ({'origin_country_1', 'o1_market_share', 'substitutability_index', 'Primary Name', 'r1_market_share', 'NAICS Sub Sector', 'refining_country_1', 'NAICS Code ID', 'refining_country_3', 'r2_market_share', 'primary_transit_vehicle', 'GICS Sector', 'o2_market_share', 'o3_market_share', 'substitute_material_id', 'Contagion Score', 'GICS Industry Group', 'NAICS Sector', 'r3_market_share', 'GICS Sub Industry', 'material_name', 'Internal ID', 'Supply Chain Tier', 'origin_country_3', 'hs_code', 'material_id', 'market_ticker', 'search_tags', 'origin_country_2', 'cost_weight_metric', 'refining_country_2'}) and 5 missing columns ({'Target Tier', 'Target Node', 'Edge Type', 'Source Node', 'Source Tier'}).
This happened while the csv dataset builder was generating data using
hf://datasets/Plainr-26/contagion_map/NAICS_Contagion_Nodes_GitHub.csv (at revision 803992d464c287b728359e711046bc141aa99e6b), [/tmp/hf-datasets-cache/medium/datasets/85938994044027-config-parquet-and-info-Plainr-26-contagion_map-6800bac8/hub/datasets--Plainr-26--contagion_map/snapshots/803992d464c287b728359e711046bc141aa99e6b/NAICS_Contagion_Edges_GitHub.csv (origin=hf://datasets/Plainr-26/contagion_map@803992d464c287b728359e711046bc141aa99e6b/NAICS_Contagion_Edges_GitHub.csv), /tmp/hf-datasets-cache/medium/datasets/85938994044027-config-parquet-and-info-Plainr-26-contagion_map-6800bac8/hub/datasets--Plainr-26--contagion_map/snapshots/803992d464c287b728359e711046bc141aa99e6b/NAICS_Contagion_Nodes_GitHub.csv (origin=hf://datasets/Plainr-26/contagion_map@803992d464c287b728359e711046bc141aa99e6b/NAICS_Contagion_Nodes_GitHub.csv)]
Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)
Traceback: Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 1800, in _prepare_split_single
writer.write_table(table)
File "/usr/local/lib/python3.12/site-packages/datasets/arrow_writer.py", line 765, in write_table
self._write_table(pa_table, writer_batch_size=writer_batch_size)
File "/usr/local/lib/python3.12/site-packages/datasets/arrow_writer.py", line 773, in _write_table
pa_table = table_cast(pa_table, self._schema)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/datasets/table.py", line 2321, in table_cast
return cast_table_to_schema(table, schema)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/datasets/table.py", line 2249, in cast_table_to_schema
raise CastError(
datasets.table.CastError: Couldn't cast
Internal ID: string
NAICS Code ID: int64
Primary Name: string
NAICS Sector: string
NAICS Sub Sector: string
GICS Sector: string
GICS Industry Group: string
GICS Sub Industry: string
Supply Chain Tier: int64
Contagion Score: double
material_id: string
material_name: string
hs_code: double
market_ticker: string
origin_country_1: string
o1_market_share: string
origin_country_2: string
o2_market_share: string
origin_country_3: string
o3_market_share: string
refining_country_1: string
r1_market_share: string
refining_country_2: string
r2_market_share: string
refining_country_3: string
r3_market_share: string
primary_transit_vehicle: string
cost_weight_metric: string
substitute_material_id: string
substitutability_index: string
search_tags: string
-- schema metadata --
pandas: '{"index_columns": [{"kind": "range", "name": null, "start": 0, "' + 4307
to
{'Source Node': Value('string'), 'Source Tier': Value('string'), 'Target Node': Value('string'), 'Target Tier': Value('string'), 'Edge Type': Value('string')}
because column names don't match
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1347, in compute_config_parquet_and_info_response
parquet_operations = convert_to_parquet(builder)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 980, in convert_to_parquet
builder.download_and_prepare(
File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 882, in download_and_prepare
self._download_and_prepare(
File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 943, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 1646, in _prepare_split
for job_id, done, content in self._prepare_split_single(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 1802, in _prepare_split_single
raise DatasetGenerationCastError.from_cast_error(
datasets.exceptions.DatasetGenerationCastError: An error occurred while generating the dataset
All the data files must have the same columns, but at some point there are 31 new columns ({'origin_country_1', 'o1_market_share', 'substitutability_index', 'Primary Name', 'r1_market_share', 'NAICS Sub Sector', 'refining_country_1', 'NAICS Code ID', 'refining_country_3', 'r2_market_share', 'primary_transit_vehicle', 'GICS Sector', 'o2_market_share', 'o3_market_share', 'substitute_material_id', 'Contagion Score', 'GICS Industry Group', 'NAICS Sector', 'r3_market_share', 'GICS Sub Industry', 'material_name', 'Internal ID', 'Supply Chain Tier', 'origin_country_3', 'hs_code', 'material_id', 'market_ticker', 'search_tags', 'origin_country_2', 'cost_weight_metric', 'refining_country_2'}) and 5 missing columns ({'Target Tier', 'Target Node', 'Edge Type', 'Source Node', 'Source Tier'}).
This happened while the csv dataset builder was generating data using
hf://datasets/Plainr-26/contagion_map/NAICS_Contagion_Nodes_GitHub.csv (at revision 803992d464c287b728359e711046bc141aa99e6b), [/tmp/hf-datasets-cache/medium/datasets/85938994044027-config-parquet-and-info-Plainr-26-contagion_map-6800bac8/hub/datasets--Plainr-26--contagion_map/snapshots/803992d464c287b728359e711046bc141aa99e6b/NAICS_Contagion_Edges_GitHub.csv (origin=hf://datasets/Plainr-26/contagion_map@803992d464c287b728359e711046bc141aa99e6b/NAICS_Contagion_Edges_GitHub.csv), /tmp/hf-datasets-cache/medium/datasets/85938994044027-config-parquet-and-info-Plainr-26-contagion_map-6800bac8/hub/datasets--Plainr-26--contagion_map/snapshots/803992d464c287b728359e711046bc141aa99e6b/NAICS_Contagion_Nodes_GitHub.csv (origin=hf://datasets/Plainr-26/contagion_map@803992d464c287b728359e711046bc141aa99e6b/NAICS_Contagion_Nodes_GitHub.csv)]
Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
Source Node string | Source Tier string | Target Node string | Target Tier string | Edge Type string |
|---|---|---|---|---|
Crude Oil | Tier 4 | Fats and Oils Refining and Blending | Tier 2 | Raw Material Flow |
Natural Gas | Tier 4 | Fats and Oils Refining and Blending | Tier 2 | Raw Material Flow |
Platinum | Tier 4 | Fats and Oils Refining and Blending | Tier 2 | Raw Material Flow |
Natural Rubber | Tier 4 | Rope, Cordage, Twine, Tire Cord, and Tire Fabric Mills | Tier 2 | Raw Material Flow |
Crude Oil | Tier 4 | Petroleum Refineries | Tier 2 | Raw Material Flow |
Natural Gas | Tier 4 | Petroleum Refineries | Tier 2 | Raw Material Flow |
Platinum | Tier 4 | Petroleum Refineries | Tier 2 | Raw Material Flow |
Crude Oil | Tier 4 | Petroleum Lubricating Oil and Grease Manufacturing | Tier 2 | Raw Material Flow |
Natural Gas | Tier 4 | Petroleum Lubricating Oil and Grease Manufacturing | Tier 2 | Raw Material Flow |
Platinum | Tier 4 | Petroleum Lubricating Oil and Grease Manufacturing | Tier 2 | Raw Material Flow |
Crude Oil | Tier 4 | All Other Petroleum and Coal Products Manufacturing | Tier 2 | Raw Material Flow |
Natural Gas | Tier 4 | All Other Petroleum and Coal Products Manufacturing | Tier 2 | Raw Material Flow |
Platinum | Tier 4 | All Other Petroleum and Coal Products Manufacturing | Tier 2 | Raw Material Flow |
Crude Oil | Tier 4 | Petrochemical Manufacturing | Tier 3 | Raw Material Flow |
Natural Gas | Tier 4 | Petrochemical Manufacturing | Tier 3 | Raw Material Flow |
Crude Oil | Tier 4 | Industrial Gas Manufacturing | Tier 3 | Raw Material Flow |
Natural Gas | Tier 4 | Industrial Gas Manufacturing | Tier 3 | Raw Material Flow |
Crude Oil | Tier 4 | Synthetic Dye and Pigment Manufacturing | Tier 3 | Raw Material Flow |
Natural Gas | Tier 4 | Synthetic Dye and Pigment Manufacturing | Tier 3 | Raw Material Flow |
Crude Oil | Tier 4 | Other Basic Inorganic Chemical Manufacturing | Tier 3 | Raw Material Flow |
Natural Gas | Tier 4 | Other Basic Inorganic Chemical Manufacturing | Tier 3 | Raw Material Flow |
Crude Oil | Tier 4 | Ethyl Alcohol Manufacturing | Tier 3 | Raw Material Flow |
Natural Gas | Tier 4 | Ethyl Alcohol Manufacturing | Tier 3 | Raw Material Flow |
Crude Oil | Tier 4 | Cyclic Crude, Intermediate, and Gum and Wood Chemical Manufacturing | Tier 3 | Raw Material Flow |
Natural Gas | Tier 4 | Cyclic Crude, Intermediate, and Gum and Wood Chemical Manufacturing | Tier 3 | Raw Material Flow |
Crude Oil | Tier 4 | All Other Basic Organic Chemical Manufacturing | Tier 3 | Raw Material Flow |
Natural Gas | Tier 4 | All Other Basic Organic Chemical Manufacturing | Tier 3 | Raw Material Flow |
Polypropylene | Tier 4 | Plastics Material and Resin Manufacturing | Tier 2 | Raw Material Flow |
Crude Oil | Tier 4 | Plastics Material and Resin Manufacturing | Tier 2 | Raw Material Flow |
Natural Gas | Tier 4 | Plastics Material and Resin Manufacturing | Tier 2 | Raw Material Flow |
Natural Rubber | Tier 4 | Synthetic Rubber Manufacturing | Tier 2 | Raw Material Flow |
Crude Oil | Tier 4 | Synthetic Rubber Manufacturing | Tier 2 | Raw Material Flow |
Natural Gas | Tier 4 | Synthetic Rubber Manufacturing | Tier 2 | Raw Material Flow |
Crude Oil | Tier 4 | Artificial and Synthetic Fibers and Filaments Manufacturing | Tier 2 | Raw Material Flow |
Natural Gas | Tier 4 | Artificial and Synthetic Fibers and Filaments Manufacturing | Tier 2 | Raw Material Flow |
Crude Oil | Tier 4 | Nitrogenous Fertilizer Manufacturing | Tier 2 | Raw Material Flow |
Natural Gas | Tier 4 | Nitrogenous Fertilizer Manufacturing | Tier 2 | Raw Material Flow |
Crude Oil | Tier 4 | Phosphatic Fertilizer Manufacturing | Tier 2 | Raw Material Flow |
Natural Gas | Tier 4 | Phosphatic Fertilizer Manufacturing | Tier 2 | Raw Material Flow |
Crude Oil | Tier 4 | Fertilizer (Mixing Only) Manufacturing | Tier 2 | Raw Material Flow |
Natural Gas | Tier 4 | Fertilizer (Mixing Only) Manufacturing | Tier 2 | Raw Material Flow |
Crude Oil | Tier 4 | Compost Manufacturing | Tier 2 | Raw Material Flow |
Natural Gas | Tier 4 | Compost Manufacturing | Tier 2 | Raw Material Flow |
Crude Oil | Tier 4 | Pesticide and Other Agricultural Chemical Manufacturing | Tier 2 | Raw Material Flow |
Natural Gas | Tier 4 | Pesticide and Other Agricultural Chemical Manufacturing | Tier 2 | Raw Material Flow |
Crude Oil | Tier 4 | Medicinal and Botanical Manufacturing | Tier 2 | Raw Material Flow |
Natural Gas | Tier 4 | Medicinal and Botanical Manufacturing | Tier 2 | Raw Material Flow |
Crude Oil | Tier 4 | Pharmaceutical Preparation Manufacturing | Tier 2 | Raw Material Flow |
Natural Gas | Tier 4 | Pharmaceutical Preparation Manufacturing | Tier 2 | Raw Material Flow |
Crude Oil | Tier 4 | In-Vitro Diagnostic Substance Manufacturing | Tier 2 | Raw Material Flow |
Natural Gas | Tier 4 | In-Vitro Diagnostic Substance Manufacturing | Tier 2 | Raw Material Flow |
Crude Oil | Tier 4 | Biological Product (except Diagnostic) Manufacturing | Tier 2 | Raw Material Flow |
Natural Gas | Tier 4 | Biological Product (except Diagnostic) Manufacturing | Tier 2 | Raw Material Flow |
Crude Oil | Tier 4 | Paint and Coating Manufacturing | Tier 2 | Raw Material Flow |
Natural Gas | Tier 4 | Paint and Coating Manufacturing | Tier 2 | Raw Material Flow |
Crude Oil | Tier 4 | Adhesive Manufacturing | Tier 2 | Raw Material Flow |
Natural Gas | Tier 4 | Adhesive Manufacturing | Tier 2 | Raw Material Flow |
Crude Oil | Tier 4 | Soap and Other Detergent Manufacturing | Tier 2 | Raw Material Flow |
Natural Gas | Tier 4 | Soap and Other Detergent Manufacturing | Tier 2 | Raw Material Flow |
Crude Oil | Tier 4 | Polish and Other Sanitation Good Manufacturing | Tier 2 | Raw Material Flow |
Natural Gas | Tier 4 | Polish and Other Sanitation Good Manufacturing | Tier 2 | Raw Material Flow |
Crude Oil | Tier 4 | Surface Active Agent Manufacturing | Tier 2 | Raw Material Flow |
Natural Gas | Tier 4 | Surface Active Agent Manufacturing | Tier 2 | Raw Material Flow |
Crude Oil | Tier 4 | Toilet Preparation Manufacturing | Tier 2 | Raw Material Flow |
Natural Gas | Tier 4 | Toilet Preparation Manufacturing | Tier 2 | Raw Material Flow |
Platinum | Tier 4 | Toilet Preparation Manufacturing | Tier 2 | Raw Material Flow |
Crude Oil | Tier 4 | Printing Ink Manufacturing | Tier 2 | Raw Material Flow |
Natural Gas | Tier 4 | Printing Ink Manufacturing | Tier 2 | Raw Material Flow |
Crude Oil | Tier 4 | Explosives Manufacturing | Tier 2 | Raw Material Flow |
Natural Gas | Tier 4 | Explosives Manufacturing | Tier 2 | Raw Material Flow |
Crude Oil | Tier 4 | Custom Compounding of Purchased Resins | Tier 2 | Raw Material Flow |
Natural Gas | Tier 4 | Custom Compounding of Purchased Resins | Tier 2 | Raw Material Flow |
Crude Oil | Tier 4 | Photographic Film, Paper, Plate, Chemical, and Copy Toner Manufacturing | Tier 2 | Raw Material Flow |
Natural Gas | Tier 4 | Photographic Film, Paper, Plate, Chemical, and Copy Toner Manufacturing | Tier 2 | Raw Material Flow |
Crude Oil | Tier 4 | All Other Miscellaneous Chemical Product and Preparation Manufacturing | Tier 2 | Raw Material Flow |
Natural Gas | Tier 4 | All Other Miscellaneous Chemical Product and Preparation Manufacturing | Tier 2 | Raw Material Flow |
Polypropylene | Tier 4 | Plastics Bag and Pouch Manufacturing | Tier 2 | Raw Material Flow |
Crude Oil | Tier 4 | Plastics Bag and Pouch Manufacturing | Tier 2 | Raw Material Flow |
Natural Gas | Tier 4 | Plastics Bag and Pouch Manufacturing | Tier 2 | Raw Material Flow |
Polypropylene | Tier 4 | Plastics Packaging Film and Sheet (including Laminated) Manufacturing | Tier 2 | Raw Material Flow |
Crude Oil | Tier 4 | Plastics Packaging Film and Sheet (including Laminated) Manufacturing | Tier 2 | Raw Material Flow |
Natural Gas | Tier 4 | Plastics Packaging Film and Sheet (including Laminated) Manufacturing | Tier 2 | Raw Material Flow |
Polypropylene | Tier 4 | Unlaminated Plastics Film and Sheet (except Packaging) Manufacturing | Tier 2 | Raw Material Flow |
Crude Oil | Tier 4 | Unlaminated Plastics Film and Sheet (except Packaging) Manufacturing | Tier 2 | Raw Material Flow |
Natural Gas | Tier 4 | Unlaminated Plastics Film and Sheet (except Packaging) Manufacturing | Tier 2 | Raw Material Flow |
Polypropylene | Tier 4 | Unlaminated Plastics Profile Shape Manufacturing | Tier 2 | Raw Material Flow |
Crude Oil | Tier 4 | Unlaminated Plastics Profile Shape Manufacturing | Tier 2 | Raw Material Flow |
Natural Gas | Tier 4 | Unlaminated Plastics Profile Shape Manufacturing | Tier 2 | Raw Material Flow |
Polypropylene | Tier 4 | Plastics Pipe and Pipe Fitting Manufacturing | Tier 2 | Raw Material Flow |
Crude Oil | Tier 4 | Plastics Pipe and Pipe Fitting Manufacturing | Tier 2 | Raw Material Flow |
Natural Gas | Tier 4 | Plastics Pipe and Pipe Fitting Manufacturing | Tier 2 | Raw Material Flow |
Polypropylene | Tier 4 | Laminated Plastics Plate, Sheet (except Packaging), and Shape Manufacturing | Tier 2 | Raw Material Flow |
Crude Oil | Tier 4 | Laminated Plastics Plate, Sheet (except Packaging), and Shape Manufacturing | Tier 2 | Raw Material Flow |
Natural Gas | Tier 4 | Laminated Plastics Plate, Sheet (except Packaging), and Shape Manufacturing | Tier 2 | Raw Material Flow |
Crude Oil | Tier 4 | Polystyrene Foam Product Manufacturing | Tier 2 | Raw Material Flow |
Natural Gas | Tier 4 | Polystyrene Foam Product Manufacturing | Tier 2 | Raw Material Flow |
Crude Oil | Tier 4 | Urethane and Other Foam Product (except Polystyrene) Manufacturing | Tier 2 | Raw Material Flow |
Natural Gas | Tier 4 | Urethane and Other Foam Product (except Polystyrene) Manufacturing | Tier 2 | Raw Material Flow |
Polypropylene | Tier 4 | Plastics Bottle Manufacturing | Tier 2 | Raw Material Flow |
Crude Oil | Tier 4 | Plastics Bottle Manufacturing | Tier 2 | Raw Material Flow |
π NAICS Contagion Map: The Physical Economy Visualized
π Join the June 2026 Beta
Welcome to the NAICS Contagion Intelligence Map β an open-source pipeline mapping the vulnerability cascades of the physical economy.
This repository bridges institutional supply chain taxonomies (NAICS) with financial market frameworks (GICS) to visualize how disruptions in upstream raw materials systematically ripple down to consumer goods.
π¦ What's Included in the Drop?
NAICS_Contagion_Map.pyThe core intelligence engine. It utilizes a deterministic heuristic algorithm to classify manufacturing nodes into Supply Chain Tiers (Tier 1 to Tier 4) and generate topological edge networks.NAICS_Contagion_Nodes_GitHub.xlsx/.csvThe flat intelligence map. Contains 346 mapped NAICS industries, their corresponding GICS cousins, their structural Tier, and their Contagion Score (1.0 - 10.0). Note: Sensitive logistics data and substitutability friction metrics are masked as[Unlock in Beta]to protect trade-secret competitive intelligence.NAICS_Contagion_Edges_GitHub.csvThe relational spiderweb. A generated list of 1,100+ topological edges showing the exact contagion cascade from Tier 4 (Commodity) -> Tier 3 (Primary Extractor) -> Tier 2 (Processor) -> Tier 1 (Final Assembler).build_visualizer.py&NAICS_Contagion_Visualizer.htmlA stunning, interactive Web application generated from the data. You can open the.htmlfile directly in any browser (no server required) to explore the system cascades interactively via an embedded physics-driven network engine.
π§ The Intelligence Framework
The Supply Chain Tiers
We categorize the physical economy into four distinct levels of depth:
- Tier 4 (Raw Materials): Foundational commodities (e.g., Lithium, Crude Oil, Platinum).
- Tier 3 (Primary Converters): Heavy extractors and baseline chemical/metal converters (e.g., Basic Chemical Mfg, Primary Metal Mfg).
- Tier 2 (Intermediate Processors): Mid-stream molders and fabricators (e.g., Fabricated Metals, Plastics, Refiners).
- Tier 1 (Direct Suppliers / OEMs): Final assembly and direct-to-consumer manufacturing (e.g., Auto Manufacturing, Food Processing, Aerospace).
The Contagion Score (1.0 - 10.0)
The Contagion Score quantifies systemic volatility.
- High Scores (8.0+): Indicate a systemic "anchor node". A bottleneck here causes catastrophic downstream starvation. Driven by high Upstream Concentration Risk and massive Downstream Connectivity.
- Medium Scores (5.0-7.9): Intermediate processors with some alternative pathways.
- Low Scores (1.0-4.9): Terminal nodes that can absorb localized shocks.
π How to Use the Data
Import the Edges and Nodes CSVs directly into network visualization tools like Gephi, Neo4j, or Python's NetworkX to build an interactive, force-directed graph of macroeconomic risk.
Contact for Enterprise Inquiry:
Email Mark: mark(at)plainr(dot)io
- Downloads last month
- -
