Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23160

How should I troubleshoot "RuntimeWarning: invalid value encountered in arccos" in NumPy?

$
0
0

I am plotting histograms showing distributions of an angle tau. I used a random normal distribution as shown:

N= 100000tau = np.arccos(np.random.normal(-1, 1, N))

I got the error "RuntimeWarning: invalid value encountered in arccos tau = np.arccos(np.random.normal(-1, 1, N))", which did not pop up with a uniform distribution. Does anyone know why this happened with the normal distribution? Thanks in advance.


Viewing all articles
Browse latest Browse all 23160

Trending Articles