dlpy.timeseries.TimeseriesTable.timeseries_formatting

TimeseriesTable.timeseries_formatting(timeid, timeseries, timeid_informat=None, timeid_format=None, extra_columns=None)

Format the TimeseriesTable

Format timeid into appropriate format and check and format timeseries columns into numeric columns.

Parameters:
timeid : string

Specifies the column name for the timeid.

timeseries : string or list-of-strings

Specifies the column name for the timeseries, that will be part of the input or output of the RNN. If str, then it is univariate time series. If list of strings, then it is multivariate timeseries.

timeid_informat : string, optional

if timeid is in the string format, this is required to parse the timeid column.
Default: None

timeid_format : string, optional

Specifies the SAS format that the timeid column will be stored in after parsing. None means it will be stored in numeric form, not a specific date or datetime format.
Default: None

extra_columns : string or list-of-strings, optional

Specifies the addtional columns to be included. Empty list means to include no extra columns other than timeid and timeseries. if None, all columns are included.
Default: None

Examples

>>> from swat import CAS
>>> from dlpy.timeseries import TimeseriesTable
>>> s=CAS("cloud.example.com", 5570)
>>> time_tbl = TimeseriesTable.from_localfile(s, "path/to/file.csv", casout=dict(name='time_tbl', replace=True))
>>> time_tbl.timeseries_formatting(timeid='datetime',
...                              timeseries='series',
...                              timeid_informat='ANYDTDTM19.',
...                              timeid_format='DATETIME19.')