Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"if data" issue #30

Open
jmgo opened this issue Sep 21, 2016 · 1 comment
Open

"if data" issue #30

jmgo opened this issue Sep 21, 2016 · 1 comment

Comments

@jmgo
Copy link

jmgo commented Sep 21, 2016

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

@DanteArucard
Copy link

DanteArucard commented May 25, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants