[Python] Z-Score on Scipy

Discussão em 'Python' iniciado por Stack, Abril 25, 2025.

  1. Stack

    Stack Membro Participativo

    I need to find out the Zscore pertaining to 1 specific point, that is, for 1 value of X using Scipy.

    Below is the manual code:

    data = [25, 37, 15, 36, 92, 28, 33, 40]
    mean = sum(data)/len(data)
    summation = 0
    for i in range(0, len(data)):
    summation += (data-mean)**2
    std = ((1/len(data))*summation))**(1/2)
    Z = (x-mean)/std


    Next, when I try to do the same with Scipy:

    Z = stats.zscore(data)


    I get the output:

    [-0.61219538 -0.05775428 -1.07422964 -0.10395771 2.48343411 -0.47358511
    -0.24256798 0.08085599]


    Maybe because I am passing only one parameter and that is the data itself. How to get the Z-Score for only one value of X?

    Continue reading...

Compartilhe esta Página