mlcolvar.io.load_dataframe

class mlcolvar.io.load_dataframe(file_names: str | list, folder: str = None, start: int = 0, stop: int = None, stride: int = 1, load_args: List[dict] = None, delete_download: bool = True, **kwargs)[source]

Bases:

Load dataframe(s) from file(s). It can be used also to open files from internet (if the string contains http). In case of PLUMED colvar files automatically handles the column names, otherwise it is just a wrapper for pd.load_csv function.

Parameters:
  • filenames (str or list[str]) – filenames to be loaded

  • folder (str, optional) – Common path for the files to be imported, by default None. If set, filenames become ‘folder/file_name’.

  • start (int, optional) – read from this row, default 0

  • stop (int, optional) – read until this row, default None

  • stride (int, optional) – read every this number, default 1

  • load_args (list[dict], optional) – List of dictionaries with the loading arguments for each file (keys: start,stop,stride and pandas.read_csv options), by default None

  • delete_download (bool, optinal) – whether to delete the downloaded file after it has been loaded, default True.

  • kwargs – keyword arguments passed to pd.load_csv function

Returns:

Dataframe

Return type:

pandas.DataFrame

Raises:

TypeError – if data is not a valid type

__init__(**kwargs)