worldfinder._internals

Functions

load_data(dir_path, csv_name)

Load data from the CSV file.

Module Contents

worldfinder._internals.load_data(dir_path, csv_name)[source]

Load data from the CSV file.

Parameters:

dir_pathstr

Path to directory containing the csv file

csv_namestr

File name of the dataset to be loaded

Returns:

DataFrame

A Pandas DataFrame containing the csv data

Raises:

TypeError

If dir_path or csv_name are not a string.

ValueError

If csv_name does not end with .csv.

FileNotFoundError

If the file at the specified path does not exist.

Examples:

>>> df = load_data("src/worldfinder/data", "countries.csv")
>>> df