Skip to content

Commit

Permalink
MNT: Replace deprecated DataFrame.append call
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Apr 4, 2022
1 parent e92d4e8 commit 87a9a74
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions bids/variables/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 87a9a74

Please sign in to comment.