I came across a line of code using Python numpy, which looked like this:
~array([0,1,2,3,4,5,4,3,2,1,0,-1,-2])
And he gave the result:
array([-1, -2, -3, -4, -5, -6, -5, -4, -3, -2, -1, 0, 1])
The unary operator (~) takes an array and applies A β - (A + 1)
If so, what is the point?
python numpy
Hooked
source share