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
datawithinput_sliceor from reading the first file path given inpath. If a single path is given andinput_sliceandoutput_sliceis none then onlydatais returned.outputs (xarray.DataArray) – The output data is produced in the same fashion as
inputsusingoutput_slice. If a list of file paths is given fordatathen this corresponds to the second.