Skip to content

Commit

Permalink
[DOC] improve docstring for VectorizedDF.items and .__iter__ (#4223)
Browse files Browse the repository at this point in the history
This improves the docstringd for `VectorizedDF.items` and `.__iter__`, see discussion in #4195
  • Loading branch information
fkiraly committed Feb 22, 2023
1 parent ce885ac commit 073d7f0
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions sktime/datatypes/_vectorize.py
Expand Up @@ -4,6 +4,10 @@
Contains VectorizedDF class.
"""

__author__ = ["fkiraly", "hoesler"]


import itertools
from itertools import product

Expand Down Expand Up @@ -314,7 +318,9 @@ def __iter__(self):
Returns
-------
An iterator over all instances
A generator over all slices/instances iterated over.
i-th element corresponds to i-th vectorization slice, rows first then cols
Same as iterating over 2nd tuple element of self.items()
"""
return (
group
Expand Down Expand Up @@ -347,7 +353,11 @@ def items(self, iterate_as=None, iterate_cols=None):
Returns
-------
An iterator over all (row name, column name, instance) tuples.
A generator returning (row index, col index, instance) tuples for vectorization.
i-th element corresponds to i-th vectorization slice, rows first then cols
2nd tuple element is X row sub-set to 0-th tuple element, col sub-set to 1-st
if no sub-setting takes place for row, 0-th tuple element is None
if no sub-setting takes place for col, 1-st tuple element is None
"""
if iterate_as is None:
iterate_as = self.iterate_as
Expand Down

0 comments on commit 073d7f0

Please sign in to comment.