netneurolab / netneurotools

Useful tools from the Network Neuroscience Lab
https://netneurolab.github.io/netneurotools
BSD 3-Clause "New" or "Revised" License
60 stars 32 forks source link

[FIX] Fix bug in dominance analysis function #101

Closed liuzhenqi77 closed 3 years ago

liuzhenqi77 commented 3 years ago

Just realized this was not the same 😱 https://github.com/netneurolab/netneurotools/pull/97#discussion_r571301858

rmarkello commented 3 years ago

Wait really? It's giving me the same thing... Is this maybe a Python version thing?

>>> n_predictor = 4
>>> print([[] for _ in range(n_predictor - 1)])
[[], [], []]
>>> print([[]] * (n_predictor - 1))
[[], [], []]
rmarkello commented 3 years ago

Ahhhh, just realized—it's just a reference to the same list! Shit, my bad. Sorry about that!!

rmarkello commented 3 years ago

@liuzhenqi77 you opened this as a draft PR—I'm assuming you want it merged in though since it's just a quick bug fix. Can you confirm?

liuzhenqi77 commented 3 years ago

Yes, thanks! :shipit: