pybasicbayes icon indicating copy to clipboard operation
pybasicbayes copied to clipboard

"if data" issue

Open jmgo opened this issue 9 years ago • 1 comments

Hi!

Just to warn for an issue that happened to me, when using "if data" it was giving me an error because my data variable was a np.array. The issue was in line 140 of the pybasicbayes/pybasicbayes/distributions/multinomial.py file.

In my case, I corrected the issue in a simple way (probably not the best)": before -> data = data if data else [None]_len(weights) after -> data = data if list(data) else [None]_len(weights)

If you could resolve this issue, it would be beneficial for the other users.

Best Regards, jmgo

jmgo avatar Sep 21 '16 14:09 jmgo

this does not work for me

File "/usr/local/lib/python2.7/site-packages/pybasicbayes/distributions/multinomial.py", line 144
    data= data if list(data) else [None]_len(weights)

Instead:

                data = data
                if data is None:
                  data= [None]*len(weights)

works and allows HMM-EM.py to execute I also tried:

data = data if data is not None else [None]_len(weights)

but I get the same syntax error

DanteArucard avatar May 25 '17 15:05 DanteArucard