rougier / numpy-100

100 numpy exercises (with solutions)
MIT License
12.17k stars 5.74k forks source link

Alternative solution for Q15 #212

Open cck181851 opened 3 months ago

cck181851 commented 3 months ago

I think learning pad function may be helpful and it is more dynamic A=numpy.zeros([4,4]) print(numpy.pad(A,(1,1),"constant",constant_values=1))

cck181851 commented 3 months ago

I just realized that Q16 is very similar and uses pad.But anyway,I think using pad is more dynamic

rougier commented 2 months ago

Thanks. Can you make a PR and add your solution alognside the old one (like alternative way: ...) ? Make sure to modify the ktx files that are used to generate others.