How to reproduce Excel's T.INV.2T in python?
In Excel, you have two functions for returning the inverse of the Student's t-distribution: T.INV and T.INV.2T.
The first returns a left-tailed inverse of the Student's t-distribution and the second returns a two-tailed one.
scipy.stats.t.ppf also returns a left-tailed inverse of t-distribution. So, if you want to compare scipy.stats.t.ppf with Excel you need to use the T.INV formula and not T.INV.2T – or you should divide the probability by two and then use it with scipy.
I've read many similar posts that say Excel's T.INV.2T(probability, degs_Freedom) can be reproduced in python using scipy.stats.t.ppf().
If I use the example of T.INV.2T(0.05, 58) excels yields 2.002.
Based on other answers posted I should get the same answer using scipy.stats.t.ppf(0.05, 58), but I do not. I get -1.672.
Any ideas on what is wrong with my syntax?