I am trying to generate a random number in Python according to a precise distribution that I define with a function f (theta) = 1 + alpha*cos(theta)²
; the variable alpha is a constant.
Unfortunately I do not know how to do it because the different random functions all follow a pre-defined distribution (normal, uniform, binomial ...)
Have you got an idea?