-
Notifications
You must be signed in to change notification settings - Fork 13
Иван Давыдов #2
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
base: main
Are you sure you want to change the base?
Иван Давыдов #2
The head ref may contain hidden characters: "\u0418\u0432\u0430\u043D_\u0414\u0430\u0432\u044B\u0434\u043E\u0432"
Conversation
|
|
||
| def findMidValue(i, j, size): | ||
| s=0 | ||
| global arr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Так делать не хорошо, лучше передавать аргументом в функцию
| def findMidValue(i, j, size): | ||
| global arr | ||
| matrix = arr[i:i + size, j:j + size, ::] | ||
| b = list(matrix.reshape(1, matrix.shape[0] * matrix.shape[1] * 3))[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Лишние действия, нужно было воспользоваться функцией sum библиотеки Numpy
|
На будущее папку .idea/ надо добавлять в .gitignore |
|
3 |
Здравствуйте, не сделал 4ый этап, поленился
И во 2ом (правильном) этапе код будет работать не всегда, только если повезет с размером сетки (size), не стал это исправлять, потому что в 3ем этапе все работает нормально