First of all, rates of convergence are usually given in the form
$$ \|u-u_h\| \leq C N^\alpha,$$
rather than equality. Furthermore, rates are asymptotic, i.e., only have to hold for $N\to \infty$. This means that you're unlikely to find a single $C$ and $\alpha$ such that your equation holds.
Another reason why your approach doesn't work is that what you're trying to fit is not a polynomial, since $\alpha$ is a) unknown and b) not an integer (for one thing, it must be negative since the error goes down as $N$ goes up).
What people usually do is look at a double-logarithmic plot: If you take the logarithm of your equation (or my inequality), you get
$$ log(\|u-u_h\|) \leq \log(CN^\alpha) = \log(C) + \alpha\log(N).$$
This is a linear polynomial $ax+b$ in $\log (N)$ with coefficients $a=\alpha$ and $b=\log(C)$ (from which you can find $C=\exp(b)$).
So if you apply
polyfit to $\log(N)$, $\log(\|u-u_h\|)$, you should get an array $[a,b]$ with $\alpha=a$ and $C=\exp(b)$.