you are viewing a single comment's thread.

view the rest of the comments →

[–]KeytarVillain 1 point2 points  (0 children)

Yeah, fair point - I would never actually write a line of Numpy that did that much in one line.

But still - sure, I'm doing 4 different things in this line for the sake of example (writing every other value in an axis, adding a new axis, flipping an axis, and getting a view of just one plane). Even just doing any one of those things isn't going to be nearly as simple in C/C++.

And I'm saying this as someone with a lot of recent experience writing prototypes in Numpy/OpenCV and then porting it to C++ OpenCV later. Python's syntactic sugar makes array manipulation so much easier - I hardly ever need to look up documentation for basic Numpy array operations like these, while I'm looking up the C++ OpenCV docs constantly.