mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 09:21:13 +08:00
[pre-commit.ci] pre-commit autoupdate (#11275)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.1.14 → v0.2.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.1.14...v0.2.0) * Upgrade pyproject.toml * Revert sudoku_solver.py RUF017 Avoid quadratic list summation --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Christian Clauss <cclauss@me.com>
This commit is contained in:
![66853113+pre-commit-ci[bot]@users.noreply.github.com](/assets/img/avatar_default.png)
committed by
GitHub

parent
4128f19170
commit
ed8d9209da
@ -22,11 +22,9 @@ def gaussian_filter(image, k_size, sigma):
|
||||
|
||||
# im2col, turn the k_size*k_size pixels into a row and np.vstack all rows
|
||||
image_array = zeros((dst_height * dst_width, k_size * k_size))
|
||||
row = 0
|
||||
for i, j in product(range(dst_height), range(dst_width)):
|
||||
for row, (i, j) in enumerate(product(range(dst_height), range(dst_width))):
|
||||
window = ravel(image[i : i + k_size, j : j + k_size])
|
||||
image_array[row, :] = window
|
||||
row += 1
|
||||
|
||||
# turn the kernel into shape(k*k, 1)
|
||||
gaussian_kernel = gen_gaussian_kernel(k_size, sigma)
|
||||
|
Reference in New Issue
Block a user