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

STY: Do not warn for 0*log(0) in entropy #226

Closed
wants to merge 1 commit into from

Conversation

jseabold
Copy link
Contributor

Minor style fix. Since 0*log(0) is handled explicitly do not warn if encountered and seterr is set to warn.

if qk is None:
vec = where(pk == 0, 0.0, pk*log(pk))
vec = pk[idx]*log(pk[idx])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this change the shape of the result?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it does. I wasn't thinking about 2d, since the below wasn't written for 2d either. See the discussion on the mailing list. I'm going to close this and see about adding xlogy to special, as you suggested.

@jseabold jseabold closed this May 22, 2012
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

Successfully merging this pull request may close these issues.

None yet

2 participants