Load a supplementary dataset distributed with countrycode.
def load_dataset(
name: str,
as_type: Literal["dict", "pandas", "polars"] = "dict"
)
Arguments
name | Dataset name. Valid values are "codelist_panel", "countryname_dict", and "cldr_examples". |
as_type | Output representation: "dict", "pandas", or "polars". |
Value
A mapping of column names to lists, a Pandas DataFrame, or a Polars DataFrame, depending on as_type.
Raises
ValueError | If name or as_type is invalid. |
ImportError | If the requested optional DataFrame library is not installed. |
Examples
panel = load_dataset("codelist_panel")
len(panel["year"]) > 1000