What does the method *.astype(int)* in [20] do?

In [20]: yhat = (predictions >= 0.5).astype(int)

If I understand it correctly the expression (predictions >= 0.5), to which this method is applied, is a Boolean expression. Is the method **.astype(int)** defined to return 1 if the Boolean expression returns True and 0 if it returns False? \

Is this method specific to Numpy or it works in Python even without the Numpy library?

Thanks ahead!