Skip to content

Commit

Permalink
Merge pull request #833 from effigies/mnt/deprecated_df_append
Browse files Browse the repository at this point in the history
MNT: Replace deprecated DataFrame.append call
  • Loading branch information
effigies authored Apr 4, 2022
2 parents c2c2fb2 + 87a9a74 commit 4b0c0f1
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 4b0c0f1

Please sign in to comment.