locan.locan_io.locdata.io_locdata.load_txt_file#
- locan.locan_io.locdata.io_locdata.load_txt_file(path, sep=',', columns=None, nrows=None, property_mapping=None, convert=True, **kwargs)[source]#
Load localization data from a txt file.
Locan column names are either supplied or read from the first line header.
- Parameters:
path (str | os.PathLike[str] | SupportsRead[Any]) – File path for a localization file to load.
sep (str) – separator between column values (Default: ‘,’)
columns (list[str] | None) – Locan column names. If None the first line is interpreted as header (Default: None).
nrows (int | None) – The number of localizations to load from file. None means that all available rows are loaded (Default: None).
property_mapping (dict[str, str] | list[dict[str, str]] | None) – Mappings between column names and locan property names
convert (bool) – If True convert types by applying type specifications in locan.constants.PROPERTY_KEYS.
kwargs (Any) – Other parameters passed to pandas.read_csv().
- Returns:
A new instance of LocData with all localizations.
- Return type: