pydynpeak.dataset

pydynpeak.dataset.load_csv(filepath, sep=',', header=None, names=None, seriesname='', timeinterval=10, timecolumn=None)

Loads the contents of the CSV file specified by filepath to a dataframe with index from 0 to (numberoflines - 1) * 10, with an increment of timeinterval.

Parameters
  • filepath (str) – absolute/relative path of the CSV file.

  • sep (str, default ',') – separator of the CSV file.

  • header (int, default 'None') – None means no header, a positive integer value indicates the row number in CSV file to be used as column headers.

  • names (array-like, default None) – List of column names to use. If file contains no header row, then you should explicitly pass header=None.

  • seriesname (str, default empty str) –

    column name to be used in combination with one-based column index, in the case headers do not exist in CSV file.

    Example

    Caraty ewes1, Caraty ewes2,… when seriesname is specified as Caraty ewes.

  • timeinterval (int, default 10) – time interval to generate the sampling time values.

  • timecolumn (int, default None) – zero-based column index that specifies the index of the column that contains sampling time values. If None, sampling time values are generated using timeinterval.

Returns

Dataframe that contains the data in CSV file with an index from 0 to (numberoflines - 1) * 10, with an increment of 10. If the specified filepath does not exist or invalid, prints a message to the user and returns.

Return type

pandas.DataFrame

pydynpeak.dataset.load_excel(filepath, sheet_name=0, header=None, names=None, seriesname='', timeinterval=10, timecolumn=None)

Loads the contents of the excel file specified by filepath to a dataframe with index from 0 to (numberoflines - 1) * 10, with an increment of timeinterval.

Parameters
  • filepath (str) – absolute/relative path of the Excel file.

  • sheet_name (str or int, default 0) – Strings are used for sheet names. Integers are used in zero-indexed sheet positions.

  • header (str, default 'None') – None means no header, a positive integer value indicates the row number in Excel file to be used as column headers.

  • names (array-like, default None) – List of column names to use. If file contains no header row, then you should explicitly pass header=None.

  • seriesname (str, default empty str) –

    column name to be used in combination with one-based column index, in the case headers do not exist in CSV file.

    Example

    Caraty ewes1, Caraty ewes2,… when seriesname is specified as Caraty ewes.

  • timeinterval (int, default 10) – time interval to generate the sampling time values.

  • timecolumn (int, default None) – zero-based column index that specifies the index of the column that contains sampling time values. If None, sampling time values are generated using timeinterval.

Returns

Dataframe that contains the data in Excel file with an index from 0 to (numberoflines - 1) * 10, with an increment of 10. If the specified filepath does not exist or invalid, prints a message to the user and returns.

Return type

pandas.DataFrame