From 7a576f0a09d18391abbab4167b872ef629710071 Mon Sep 17 00:00:00 2001 From: Noko-Github Date: Sat, 25 Nov 2023 16:23:36 +0900 Subject: [PATCH] Fix error To avoid the error 'The truth value of an array with more than one element is ambiguous.', we don't use walrus operator. --- seaborn/_base.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/seaborn/_base.py b/seaborn/_base.py index 9e1961e6e5..28f25dd91b 100644 --- a/seaborn/_base.py +++ b/seaborn/_base.py @@ -933,10 +933,8 @@ def iter_data( grouping_keys = [] for var in grouping_vars: - if key := levels.get(var): - grouping_keys.append(key) - else: - grouping_keys.append([]) + key = levels.get(var) if levels.get(var) is not None else [] + grouping_keys.append(key) iter_keys = itertools.product(*grouping_keys) if reverse: