I have to calculate the covariance between 2 parameters from a fit function. I found this package in Python called iminuit that did a good fit and also calculate the covariance matrix of the parameters. I tested the package on a simple function. This is the code:
from iminuit import Minuit, describe, Struct
m = Minuit(func,pedantic=False,print_level=0)
You are confusing covariance with correlation. Correlation is the normalised version of the covariance, which is indeed always between -1 and 1.
To obtain the corellation from the covariance matrix, calculate:
correlation = cov[0, 1] / np.sqrt(cov[0, 0] * cov[1, 1])