dlpy.timeseries.TimeseriesTable.from_table

classmethod TimeseriesTable.from_table(tbl, columns=None, casout=None)

Create an TimeseriesTable from a CASTable

Parameters:
tbl : CASTable

The CASTable object to use as the source.

columns : list-of-strings, optional

Columns to keep when loading the data. None means it will include all the columns from the source. Empty list means include no column, which will generate empty data.
Default: None

casout : dict or CASTable, optional

if it is dict, it specifies the output CASTable parameters. if it is CASTable, it is the CASTable that will be overwritten. None means a new CASTable with random name will be generated.
Default: None

Returns:
TimeseriesTable

Examples

>>> from swat import CAS
>>> from dlpy.timeseries import TimeseriesTable
>>> s=CAS("cloud.example.com", 5570)
>>> tbl = s.loadTable(path="path/to/table", casout="table")
>>> time_tbl = TimeseriesTable.from_table(
... tbl,
... columns=['id1var', 'date', 'series'],
... casout=dict(name='time_tbl', replace=True)
... )