We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Noticing some places where some use of numpy functions would be more efficient!
https://github.com/cosmoharrigan/matrix-entropy/blob/master/calculate_profile.py#L43 So I think an easier way to do the dict(Counter(...)) would be to use `numpy.unique(..., return_counts=True).
dict(Counter(...))
But the larger issue was that moving window function (https://github.com/cosmoharrigan/matrix-entropy/blob/master/moving_window_filter.py#L11) could be computed using scipy.convolve2d (https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.convolve2d.html). It feels more natural to rely on natural operations like convolution rather than doing the triple-nested for-loops.
scipy.convolve2d
Felt like some functions could stay more within the numpy/scipy ecosystem, for such a matrix heavy calculation. Just my two cents!
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Noticing some places where some use of numpy functions would be more efficient!
https://github.com/cosmoharrigan/matrix-entropy/blob/master/calculate_profile.py#L43
So I think an easier way to do the
dict(Counter(...))
would be to use `numpy.unique(..., return_counts=True).But the larger issue was that moving window function (https://github.com/cosmoharrigan/matrix-entropy/blob/master/moving_window_filter.py#L11) could be computed using
scipy.convolve2d
(https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.convolve2d.html). It feels more natural to rely on natural operations like convolution rather than doing the triple-nested for-loops.Felt like some functions could stay more within the numpy/scipy ecosystem, for such a matrix heavy calculation. Just my two cents!
The text was updated successfully, but these errors were encountered: