hypertools-paper-notebooks icon indicating copy to clipboard operation
hypertools-paper-notebooks copied to clipboard

does not seem to work with Python 3

Open AlanTJohnstone opened this issue 7 years ago • 3 comments

Here is an error when running the hypercube notebook which I believe is due to Pyhton 3 issues. I am using version 0.4.2 of hypertools. DIMS: 3


TypeError Traceback (most recent call last) in () 1 for dims in range(3,9): 2 print('DIMS: ' + str(dims)) ----> 3 hyp.plot(hypercube(dims), 'k.')

in hypercube(ndims, res, x_min, x_max) 1 def hypercube(ndims=4, res=100, x_min=-1, x_max=1): 2 length = x_max - x_min ----> 3 vertices = (ff2n(ndims) + 1) / 2 4 vertices *= length 5 vertices += x_min

~\Anaconda3\lib\site-packages\pyDOE\doe_factorial.py in ff2n(n) 113 [ 1., -1., 1.], 114 [-1., 1., 1.], --> 115 [ 1., 1., 1.]]) 116 117 """

~\Anaconda3\lib\site-packages\pyDOE\doe_factorial.py in fullfact(levels) 76 lvl = [] 77 for j in range(levels[i]): ---> 78 lvl += [j]int(level_repeat) 79 80 rng = lvlint(range_repeat)

TypeError: 'numpy.float64' object cannot be interpreted as an integer

​ALan

AlanTJohnstone avatar Jan 31 '18 18:01 AlanTJohnstone

Hi Alan, thanks for the catch! It is indeed related to python3 and i will fix it

andrewheusser avatar Jan 31 '18 19:01 andrewheusser

Andy, Thanks for the quick response. Perhaps you could let me know when the code is fixed so I can download it again.

Also I could not get geo_tsne = hyp.plot(data, '.', reduce='TSNE', ndims=3) in the mushrooms notebook to work – it just never returns (asterisk forever!) All the rest seems to work though it is going to take me ages to understand it all. But what a brilliant tool! Thanks again Alan From: Andy Heusser Sent: Wednesday, January 31, 2018 7:04 PM To: ContextLab/hypertools-paper-notebooks Cc: Alan ; Author Subject: Re: [ContextLab/hypertools-paper-notebooks] does not seem to work with Python 3 (#3)

Hi Alan, thanks for the catch! It is indeed related to python3 and i will fix it

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

AlanTJohnstone avatar Jan 31 '18 19:01 AlanTJohnstone

Sorry I forgot one other problem I found.

I did initially try to download from github and in one of the test plots I encountered an error with from umap import UMAP

UMAP does not seem to exist, at least i cannot find a version of the module where it does exist.

Alan

From: Andy Heusser Sent: Wednesday, January 31, 2018 7:04 PM To: ContextLab/hypertools-paper-notebooks Cc: Alan ; Author Subject: Re: [ContextLab/hypertools-paper-notebooks] does not seem to work with Python 3 (#3)

Hi Alan, thanks for the catch! It is indeed related to python3 and i will fix it

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

AlanTJohnstone avatar Jan 31 '18 19:01 AlanTJohnstone