A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://tslearn.readthedocs.io/en/stable/gen_modules/utils/tslearn.utils.ts_size.html below:

tslearn.utils.ts_size — tslearn 0.6.4 documentation

tslearn.utils.ts_size
tslearn.utils.ts_size(ts, be=None)[source]

Returns actual time series size.

Final timesteps that have NaN values for all dimensions will be removed from the count. Infinity and negative infinity ar considered valid time series values.

Parameters:
tsarray-like

A time series.

beBackend object or string or None

Backend. If be is an instance of the class NumPyBackend or the string “numpy”, the NumPy backend is used. If be is an instance of the class PyTorchBackend or the string “pytorch”, the PyTorch backend is used. If be is None, the backend is determined by the input arrays. See our dedicated user-guide page for more information.

Returns:
int

Actual size of the time series.

Examples

>>> ts_size([1, 2, 3, numpy.nan])
3
>>> ts_size([1, numpy.nan])
1
>>> ts_size([numpy.nan])
0
>>> ts_size([[1, 2],
...          [2, 3],
...          [3, 4],
...          [numpy.nan, 2],
...          [numpy.nan, numpy.nan]])
4
>>> ts_size([numpy.nan, 3, numpy.inf, numpy.nan])
3
Examples using tslearn.utils.ts_size

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4