Logistic Regression can't fit my data
The problem is in the following line:

q[j][0]=q[j][0]-alpha*np.sum((h-y)*a[:,j]);


(h-y) has shape (20, 1), a[:,j] has shape (20), multiplying them results in a shape (20, 20), which is wrong.

Try a[:,j:j+1] instead of a[:,j] and it'll start working:

q[j][0]=q[j][0]-alpha*np.sum((h-y)*a[:,j:j+1]);


This gives the following plot:



You could adjust the shapes of your variables a bit to make it easier:

x=data[:,:1]
y=data[:,1]
a=np.hstack([np.ones((len(x), 1)), x])
q=np.ones(a.shape[1])
alpha=0.003

for i in range(10000):
    h=1/(1+np.exp(-np.dot(a,q)))
    for j in range(len(q)):
        q[j]=q[j]-alpha*np.sum((h-y)*a[:,j])

plt.plot(x,y,'x',x,h)
plt.show()


Also note that in Python you don't need ; at the end of each line.