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 &amp; Numpy:

. 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 &quot;picture&quot; for this problem was sweeping all data values for some region into a pile in the center
of the region.
Examples:
&gt;&gt;&gt;CO
array ([ [9, 1, 6],
[9, 3, 5],
[6, 2, 5]])
&gt;&gt;&gt; c0 . sum( )
46
&gt;&gt;&gt;concentrate(c0, 3)
array ([[ 0, 0,
0] ,
[ 0, 46,
0] ,
[ 0, 0, 0]])
&gt;&gt;&gt;C0
array ([[ 0 , 0,
0] ,
[ 0, 46,
0] ,
[ 0, 0,
0]])

#### 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

r

### 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.
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes