-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from UBC-MDS/rnorm
added docstrings as well as empty test for rnorm function
- Loading branch information
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
def rnorm(n, mean=0, sd=1): | ||
""" | ||
This function generates a vector (NumPy array) of length n normally distributed | ||
random variables with mean equal to the `mean` and sd equal to the `sd`. | ||
Parameters | ||
---------- | ||
n : int | ||
The number of random variables to be simulated. | ||
mean : float, optional | ||
The mean value of the normal distribution. Default is 0. | ||
sd : float, optional | ||
The standard deviation of the normal distribution. Default is 1. | ||
Returns | ||
------- | ||
numpy.ndarray | ||
A NumPy array of length n containing normally distributed random variables | ||
with mean equal to `mean` and sd equal to `sd`. | ||
Examples | ||
------- | ||
>>> rnorm(2, mean=5, sd=2) | ||
array([6.3245, 4.5983]) | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from pystats.rnorm import rnorm |