Skip to content

Commit

Permalink
Updated to pd.concat sort=True
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelkyu committed Dec 8, 2018
1 parent 6839d74 commit de4e141
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions ddot/Ontology.py
Original file line number Diff line number Diff line change
Expand Up @@ -1642,7 +1642,11 @@ def from_table(cls,
mapping_attr = mapping.set_index([mapping_child, mapping_parent])
mapping_attr.index.rename(['Child', 'Parent'], inplace=True)

edge_attr = pd.concat([edge_attr, mapping_attr])
try:
# Used for pandas version >= 0.23
edge_attr = pd.concat([edge_attr, mapping_attr], sort=True)
except:
edge_attr = pd.concat([edge_attr, mapping_attr])
mapping = mapping.loc[:,[mapping_child, mapping_parent]]
hierarchy = table.loc[:,[child, parent]]

Expand Down Expand Up @@ -2104,7 +2108,11 @@ def focus(self,
new_nodes = new_connections['Child'].values.tolist()
new_connections['Summary'] = True
df['Summary'] = False
tmp = pd.concat([df, new_connections], ignore_index=True)
try:
# Used for pandas version >= 0.23
tmp = pd.concat([df, new_connections], ignore_index=True, sort=True)
except:
tmp = pd.concat([df, new_connections], ignore_index=True)
df = tmp[df.columns]

ont = Ontology.from_table(df)
Expand Down

0 comments on commit de4e141

Please sign in to comment.