hydromt.data_adapter.DataFrameAdapter.to_file#

DataFrameAdapter.to_file(data_root, data_name, driver=None, variables=None, time_tuple=None, logger=<Logger hydromt.data_adapter.dataframe (WARNING)>, **kwargs)[source]#

Save a dataframe slice to a file.

Parameters:
  • data_root (str or Path) – Path to the output folder.

  • data_name (str) – Name of the output file without extension.

  • driver (str, optional) – Driver to write the file, e.g., ‘csv’,’parquet’, ‘excel’. If None, the default behavior is used.

  • variables (list of str, optional) – Names of DataFrame columns to include in the output. By default, all columns are included.

  • time_tuple (tuple of str or datetime, optional) – Start and end date of the period of interest. By default, the entire time period of the DataFrame is included.

  • **kwargs (dict) – Additional keyword arguments to be passed to the file writing method.

Returns:

  • fn_out (str) – Absolute path to the output file.

  • driver (str) – Name of the driver used to read the data. See get_geodataset().

  • kwargs (dict) – The additional keyword arguments that were passed in.