3
Good evening, everyone
I’m a beginner in Python and I would like your help, I did this program but the answer is in the form of several vectors or 24 vectors, and in reality I wanted only a Matrix(24,1), follows below what I did, I thank you already:
import numpy as np
import pandas as pd
ex = pd.read_excel('3.1.xlsx')
meanX1 = np.mean(ex.X1)
meanX2 = np.mean(ex.X2)
meanI = np.mean(ex.I)
stdX1 =np.std(ex.X1)
stdX2 =np.std(ex.X2)
stdI =np.std(ex.I)
for i in range(0, 25):
aux = np.zeros([1,1])
X1std = aux + (ex.X1[i] - meanX1)/stdX1
print(X1std)
the answer is this with 24 vectors, I would like a column Matrix with 24 lines:
[[-0.26102763]]
[[-0.85427226]]
[[-0.85427226]]
[[-0.7059611]]
[[-0.40933879]]
[[-0.26102763]]
[[-1.00258342]]
[[-0.26102763]]
[[3.15012896]]
[[-0.55764995]]
[[1.07377277]]
[[0.18390583]]
[[-0.7059611]]
[[-0.40933879]]
[[0.03559468]]
[[0.18390583]]
[[-0.40933879]]
[[-0.26102763]]
[[-0.85427226]]
[[1.22208393]]
[[0.18390583]]
[[2.55688433]]
[[0.03559468]]
[[-0.11271648]]
[[-0.7059611]]
Thank you very much !!! his idea led me to other paths and tried his also unsuccessfully, I went to find the answer in Pandas as as follows:Xistd = pd.Series([ex.XI[i] - meanXI)/stdXI for i in range(0, 25)]) XI = Xistd.values
– Dexter
For nothing, consider evaluating the answer.
– FourZeroFive