'truncnorm generates values below lower boundary

I want to generate normal distributed values and have found this post: How to specify upper and lower limits when using numpy.random.normal However when I run the following code I get negative values below the lower limit as well

seed = 1
random.seed(seed)
np.random.seed(seed)

lower = 100_000
mean =  600_000_000
sigma = 700_000_000
nrows = 2000
upper = 10000000000


series = pd.Series(stats.truncnorm(
                    (lower - mean) / sigma,
                    (upper - mean) / sigma,
                    loc=mean,
                    scale=sigma,
                )
                .rvs(size=nrows)
                .astype(int))
series.hist()

enter image description here

What can I do to only get values above the lower limit?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source