pyMAISE.preprocessing.read_csv

pyMAISE.preprocessing.read_csv(path, input_slice=None, output_slice=None, header='infer')[source]

Read comma-separated values (csv) file into xarray.DataArray. This is used for an entire data set and/or its inputs and outputs.

Parameters:
  • path (str or list of str) – The path to the single input file containing both inputs and outputs or a list of two paths, the first to the inputs and the second to the outputs.

  • input_slice (slice or None, default=None) – Index slice of inputs from a data set containing both inputs and outputs for a single string path.

  • output_slice (slice or None, default=None) – Index slice of outputs from a data set containing both inputs and outputs for a single string path.

  • header (int, 'infer', or None, default=`infer`) – Row number(s) containing column labels and marking the start of the data. Used in pandas.read_csv [M+10].

Returns:

  • data (xarray.DataArray) – The input and output data given by the files.

  • inputs (xarray.DataArray) – The input data produced from either slicing data with input_slice or from reading the first file path given in path. If a single path is given and input_slice and output_slice is none then only data is returned.

  • outputs (xarray.DataArray) – The output data is produced in the same fashion as inputs using output_slice. If a list of file paths is given for data then this corresponds to the second.