7 ms·
I have a friend who complains that that it would be nice, on some occasions, to specify the shape of the result from a numpy computation. -that it is all to ea
by tobmlt 6y ago
I have a friend who complains that that it would be nice, on some occasions, to specify the shape of the result from a numpy computation. -that it is all to easy to duck type your way into a linear algebra bug that isn’t easily caught.
My response is that, in those cases, go ahead and declare the array you want to catch the result (and it’s shape), then use [:] etc. appropriately to ensure that if the size doesn’t match between computed and expected at the point of assignment, it will fail.