LauritsSkov / Introgression-detection

MIT License
36 stars 12 forks source link

AttributeError: 'long' object has no attribute 'log' #1

Closed shengwang closed 2 years ago

shengwang commented 5 years ago

Line 225: fractorials[i] = ng.log(math.factorial(obs)) -> fractorials[i] = math.log(math.factorial(obs))

stsmall commented 4 years ago

I guess this is a known bug in numpy at least as of this posting: https://stackoverflow.com/questions/31613444/why-cant-numpy-compute-long-objects

I changed that line to math.log and the code ran. You also need to add "import math" to the beginning of the file. I suppose you can also change the object to float as they suggested in the thread, then you wont need to import anything extra