MrPowers / quinn

pyspark methods to enhance developer productivity 📣 👯 🎉
https://mrpowers.github.io/quinn/
Apache License 2.0
602 stars 96 forks source link

Add random laplace number and div_or_else function #155

Closed SemyonSinchenko closed 8 months ago

SemyonSinchenko commented 8 months ago

On branch feature/random-fenerators Changes to be committed: new file: quinn/math.py

Related to #88

I have no idea how to test generation of random numbers without installing numpy. But I made few local tests and looks like it works.

  1. There is the result of rand_laplace(mu=-5, beta=4): laplace_m5_4

  2. There is the result of rand_laplace(mu=1, beta=2): laplace_1_2

And there is how it should look like based on Wiki: image

One can see that distribution is correct. Also negative mu is processed correctly too.

SemyonSinchenko commented 8 months ago

@jeffbrennan I went though the issue and see that we discussed that this part will be used like quinn.math. What do you think about it? In this case it is not needed to add it to __init__.py

jeffbrennan commented 8 months ago

@SemyonSinchenko

Yeah looks good then. Thanks for checking that