mapreader.utils.load_frames

Functions

eval_dataframe(df)

Evaluates the columns of a DataFrame/GeoDataFrame and converts them to their respective types.

load_from_csv(fpath[, index_col])

load_from_geojson(fpath, **kwargs)

load_from_excel(fpath[, index_col])

get_load_function(fpath, **kwargs)

Find function to load a DataFrame/GeoDataFrame from a file path.

check_exists(fpath)

get_geodataframe(df)

Module Contents

mapreader.utils.load_frames.eval_dataframe(df)

Evaluates the columns of a DataFrame/GeoDataFrame and converts them to their respective types.

Parameters:

df (pd.DataFrame | gpd.GeoDataFrame) – The DataFrame/GeoDataFrame to evaluate.

Returns:

The evaluated DataFrame/GeoDataFrame.

Return type:

pd.DataFrame | gpd.GeoDataFrame

mapreader.utils.load_frames.load_from_csv(fpath, index_col=0, **kwargs)
Parameters:
  • fpath (str)

  • index_col (int | str | None)

mapreader.utils.load_frames.load_from_geojson(fpath, **kwargs)
Parameters:

fpath (str)

mapreader.utils.load_frames.load_from_excel(fpath, index_col=0, **kwargs)
Parameters:
  • fpath (str)

  • index_col (int | str | None)

mapreader.utils.load_frames.get_load_function(fpath, **kwargs)

Find function to load a DataFrame/GeoDataFrame from a file path.

Parameters:

fpath (str or pathlib.Path) – The file path to load the DataFrame/GeoDataFrame from. Can be a CSV/TSV/etc., or Excel or JSON/GeoJSON file.

mapreader.utils.load_frames.check_exists(fpath)
mapreader.utils.load_frames.get_geodataframe(df)
Parameters:

df (pandas.DataFrame)