From 87a9a740e3cc4edd58a1dde1f822536762aa2610 Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Mon, 4 Apr 2022 10:52:25 -0400 Subject: [PATCH] MNT: Replace deprecated DataFrame.append call --- bids/variables/entities.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bids/variables/entities.py b/bids/variables/entities.py index 19f11c1ae..486f18524 100644 --- a/bids/variables/entities.py +++ b/bids/variables/entities.py @@ -241,8 +241,11 @@ def create_node(self, level, entities, *args, **kwargs): entities = dict(entities, node_index=len(self.nodes), level=level) self.nodes.append(node) - node_row = pd.Series(entities) - self.index = self.index.append(node_row, ignore_index=True) + # Because "entities" may have non-scalar values (such as `SliceTiming`) + # we need to first create a Series to avoid expansion + # From here we can concatenate + node_row = pd.DataFrame(pd.Series(entities)).T + self.index = pd.concat([self.index, node_row], ignore_index=True) return node def get_or_create_node(self, level, entities, *args, **kwargs):