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

RuntimeWarning during the processing from get_j/statistics.py: divide by zero encountered in log p = np.polyfit(np.log(dias[ind]), np.log(number_distribution[ind]), 1) #313

Closed
arsalanmstn opened this issue Sep 25, 2024 · 1 comment · Fixed by #314
Labels
bug Something isn't working

Comments

@arsalanmstn
Copy link
Contributor

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Detailed steps to reproduce the behavior.

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

@arsalanmstn arsalanmstn changed the title RuntimeWarning during the processing raised from from statistics.py: divide by zero encountered in log p = np.polyfit(np.log(dias[ind]), np.log(number_distribution[ind]), 1) RuntimeWarning during the processing from statistics.py: divide by zero encountered in log p = np.polyfit(np.log(dias[ind]), np.log(number_distribution[ind]), 1) Sep 25, 2024
@arsalanmstn arsalanmstn changed the title RuntimeWarning during the processing from statistics.py: divide by zero encountered in log p = np.polyfit(np.log(dias[ind]), np.log(number_distribution[ind]), 1) RuntimeWarning during the processing from get_j/statistics.py: divide by zero encountered in log p = np.polyfit(np.log(dias[ind]), np.log(number_distribution[ind]), 1) Sep 25, 2024
@arsalanmstn
Copy link
Contributor Author

Suggestion: update the following line in the get_j function:
p = np.polyfit(np.log(dias[ind]), np.log(number_distribution[ind]), 1)
to:
p = np.polyfit(np.log(dias[ind]), np.log(number_distribution[ind], where= number_distribution[ind]> 0), 1)

@emlynjdavies emlynjdavies added the bug Something isn't working label Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants