Skip to content

Commit 4b0c0f1

Browse files
authored
Merge pull request #833 from effigies/mnt/deprecated_df_append
MNT: Replace deprecated DataFrame.append call
2 parents c2c2fb2 + 87a9a74 commit 4b0c0f1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

bids/variables/entities.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,11 @@ def create_node(self, level, entities, *args, **kwargs):
241241

242242
entities = dict(entities, node_index=len(self.nodes), level=level)
243243
self.nodes.append(node)
244-
node_row = pd.Series(entities)
245-
self.index = self.index.append(node_row, ignore_index=True)
244+
# Because "entities" may have non-scalar values (such as `SliceTiming`)
245+
# we need to first create a Series to avoid expansion
246+
# From here we can concatenate
247+
node_row = pd.DataFrame(pd.Series(entities)).T
248+
self.index = pd.concat([self.index, node_row], ignore_index=True)
246249
return node
247250

248251
def get_or_create_node(self, level, entities, *args, **kwargs):

0 commit comments

Comments
 (0)