M = np.vstack([np.ones(len(xdata)), np.log(xdata), xdata]).T
logA, alpha, B = np.linalg.lstsq(M, np.log(ydata))[0]
print('A =', np.exp(logA))
print('alpha =', alpha)
print('B =', B)
Wrong fit using scipy curve_fit