Are you sure that your x is a 2D array of shape (N, 2) or (N, 3)? It seems that after taking a dot product of w and x you are getting a scalar, which would imply that your x is actually just a 1D vector. The error message basically says that you cannot index a scalar (where numpy.float64 is a data type of this scalar).
EDIT: In general, x does not have to be a 2D array in the predict() function, but your current implementation will only work if it is.