From 877c2f5f2ea434e4997573f79bd08b47be652305 Mon Sep 17 00:00:00 2001 From: Maria Kunilovskaya <31110835+kunilovskaya@users.noreply.github.com> Date: Mon, 11 May 2020 15:13:20 +0100 Subject: [PATCH] fix brackets in (original) list(zip(*g)[0]) It has been pointed out already, but it is not fixed! See issue https://github.com/claesenm/optunity/issues/94 --- optunity/cross_validation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/optunity/cross_validation.py b/optunity/cross_validation.py index 4021719..d38e64e 100755 --- a/optunity/cross_validation.py +++ b/optunity/cross_validation.py @@ -104,7 +104,7 @@ def strata_by_labels(labels): :param labels: iterable, identical values will end up in identical strata :returns: the strata, as a list of lists """ - return [list(zip(*g)[0]) + return [list(zip(*g))[0] for _, g in it.groupby(enumerate(labels), op.itemgetter(1))] def _fold_sizes(num_rows, num_folds):