{
"rpc": "https://<network>.infura.io",
"keys": ["put-your-priv-key-here"]
}
| import cmath | |
| import numpy as np | |
| import scipy.stats as stats | |
| def mean(angles, deg=True): | |
| '''Circular mean of angle data(default to degree) | |
| ''' | |
| a = np.deg2rad(angles) if deg else np.array(angles) | |
| angles_complex = np.frompyfunc(cmath.exp, 1, 1)(a * 1j) | |
| mean = cmath.phase(angles_complex.sum()) % (2 * np.pi) |