Solved by Expert Tutors
concentrate: (20 points) This function takes a positive odd integer N and a NumPy array a whose width and height are both a multiple of the integer...
Solved by Expert Tutors
Question

Please solve using Python & Numpy:


Screen Shot 2019-10-01 at 9.23.23 PM.png

Screen Shot 2019-10-01 at 9.23.33 PM.png

Screen Shot 2019-10-01 at 9.23.23 PM.png
. concentrate: (20 points) This function takes a positive odd integer N and a NumPy array a whose
width and height are both a multiple of the integer N. For each NxN block of values in a, concentrate
replaces the center value with the sum of the values in the NxN block and then zeroes the other values. It
returns a.
My initial "picture" for this problem was sweeping all data values for some region into a pile in the center
of the region.
Examples:
>>>CO
array ([ [9, 1, 6],
[9, 3, 5],
[6, 2, 5]])
>>> c0 . sum( )
46
>>>concentrate(c0, 3)
array ([[ 0, 0,
0] ,
[ 0, 46,
0] ,
[ 0, 0, 0]])
>>>C0
array ([[ 0 , 0,
0] ,
[ 0, 46,
0] ,
[ 0, 0,
0]])
Screen Shot 2019-10-01 at 9.23.33 PM.png

Step-by-step answer

The student who asked this found it Helpful

ng elit. Nam lacinia pu

congue vel laoreet ac, dictum vitae odio

acinia pulvillent

amet, csnecatiamet, conserisusfs a molestiicac,fur laor0itur laoreet. Nam risus ante, dapiicmolfur laor0ec alique0ce dui lectus, congue vel laoreet ac, dictum vitae odio. Donec aliquet. Lorem ipsum dolor sit amet, consectetur0ac, dictum vitae odio. Donec aliquet. Lollestiel, dictum vitae oor neo. Do



nec facilis

Capture.PNG

Capture.PNG
r

Subscribe to view the full answer

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question
Let our 24/7 Python Programming tutors help you get unstuck! Ask your first question.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes