16. API Book

If you developed an amazing library or tool, you need to teach the users how to use it. Now a API book is necessary and a good API book will save a lot of time for the users. The Sphinx provides an awesome auto API book generator. The followings are my statistics python library: statspy API demo book:

16.1. Basics Module

16.1.1. rnorm

statspy.basics.rnorm(n, mean=0, sd=1)[source]

Random generation for the normal distribution with mean equal to mean and standard deviation equation to sd same functions as rnorm in r: rnorm(n, mean=0, sd=1)

Parameters
  • n – the number of the observations

  • mean – vector of means

  • sd – vector of standard deviations

Returns

the vector of the random numbers

Author

Wenqiang Feng

Email

von198@gmail.com

16.1.2. dnorm

statspy.basics.dnorm(x, mean=0, sd=1, log=False)[source]

Density of the normal distribution with mean equal to mean and standard deviation equation to sd same functions as rnorm in r: dnorm(x, mean=0, sd=1, log=FALSE)

Parameters
  • x – the vector od quantiles

  • mean – vector of means

  • sd – vector of standard deviations

Returns

the list of the density

Author

Wenqiang Feng

Email

von198@gmail.com

16.1.3. runif

statspy.basics.runif(n, min=0, max=1)[source]

Random generation from the uniform distribution same functions as rnorm in r: runif(n, min=0, max=1)

Parameters
  • n – the number of the observations

  • min – the lower limit of the distribution

  • max – the upper limit of the distribution

Returns

the list of n uniform random numers

Author

Wenqiang Feng

Email

von198@gmail.com

16.2. Tests Module

16.2.1. T-test

statspy.tests.t_test(x, y=None, mu=0.0, conf_level=0.95)[source]

Performs one and two sample t-tests on vectors of data.

same functions as t.test in r: t.test(x, ...)

t.test(x, y = NULL,

alternative = c("two.sided", "less", "greater"),

mu = 0, paired = FALSE, var.equal = FALSE,

conf.level = 0.95, ...)

Parameters
  • x – a (non-empty) numeric vector of data values.

  • y – an optional (non-empty) numeric vector of data values.

  • mu – vector of standard deviations.

  • conf_level – confidence level of the interval.

Returns

the vector of the random numbers.

Author

Wenqiang Feng

Email

von198@gmail.com