Interview Query

t Value via Pandas

Start Timer

0:00:00

Upvote
7
Downvote
Save question
Mark as completed
View comments (12)
Next question

You are given a dataframe with a single column, 'var'.

Calculated the t-value for the mean of ‘var’ against a null hypothesis that μ=μ0μ = μ_0.

Note: You do not have to calculate the p-value of the test or run the test.

Example:

Input:

mu0 = 1
print(df)
...
   var
0  -34
1   40
2  -89
3    5
4  -26

Output:

def t_score(mu0, df) ->
var   -1.015614
dtype: float64
.
.
.
.
.


Comments

Loading comments