Created
January 12, 2019 20:30
-
-
Save mkcook/ae5313cc222ca97b51abc2a38453da2d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for i in range(len(df.index.values)): | |
| if df.index.values[i] in list(id2motif.keys()): | |
| one = df.loc[df.index.values[i]] | |
| for j in range(i+1, len(df.index.values)): | |
| if df.index.values[j] in list(id2motif.keys()): | |
| two = df.loc[df.index.values[j]] | |
| print(df.index.values[i],df.index.values[j]) | |
| stats.pearsonr(one,two) | |
| # above function wasn't producing results, figured out that it was getting through the "in range" part | |
| # but was never "in list" of the keys | |
| # df value at 1 is 196, which IS in the list of id keys, but it always returns false when I try to use df.index.values[1] | |
| # or give it a placeholder name | |
| df.index.values[1] | |
| '196' in list(id2motif.keys()) | |
| df.index.values[1] in list(id2motif.keys()) | |
| item = df.index.values[1] | |
| print(item) | |
| item in list(id2motif.keys()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment