Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOC] Update Docstring for ColumnConcatenator #4272

Merged
merged 4 commits into from Feb 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
33 changes: 31 additions & 2 deletions sktime/transformations/panel/compose.py
Expand Up @@ -215,8 +215,37 @@ class ColumnConcatenator(BaseTransformer):
"""Concatenate multivariate series to a long univariate series.

Transformer that concatenates multivariate time series/panel data
into long univariate time series/panel
data by simply concatenating times series in time.
into single univariate time series/panel data by concatenating
each individual series on top of each other from left to right.

Uses pandas method stack() to do the concatenating

Examples
--------
>>> from sktime.transformations.panel.compose import ColumnConcatenator # noqa: E501
>>> import numpy as np
>>> data = np.array([[1, 2, 3],
... [4, 5, 6],
... [7, 8, 9]])
>>> concatenator = ColumnConcatenator()
>>> concatenator.fit_transform(data)
array([[1.],
[4.],
[7.],
[2.],
[5.],
[8.],
[3.],
[6.],
[9.]])

Another example with panel data.

>>> from sktime.utils._testing.panel import _make_panel
>>> panel_data = _make_panel(n_columns = 2,
... n_instances = 2,
... n_timepoints = 3)
>>> panel_data = concatenator.fit_transform(panel_data)
"""

_tags = {
Expand Down