Skip to content

Commit 7214fd4

Browse files
authored
Merge pull request #42 from TyberiusPrime/master
Significant speed up in pandasGEXpress
2 parents c3631b7 + c1653b5 commit 7214fd4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cmapPy/pandasGEXpress/parse_gctx.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,8 @@ def get_ordered_idx(id_type, id_list, meta_df):
229229
if id_type is None:
230230
id_list = range(0, len(list(meta_df.index)))
231231
elif id_type == "id":
232-
id_list = [list(meta_df.index).index(str(i)) for i in id_list]
232+
lookup = {x: i for (i,x) in enumerate(meta_df.index)}
233+
id_list = [lookup[str(i)] for i in id_list]
233234
return sorted(id_list)
234235
else:
235236
return None

0 commit comments

Comments
 (0)