I am getting this error:
File "mypath\mypythonscript.py", line 3484, in secondfunction
RRDuringArray = p.array(UnFilteredDuringExSummaryOfMeansArray,dtype=p.float64)[1:,3]
ValueError: setting an array element with a sequence.
When I run this python code:
import numpy as p
def firstfunction():
UnFilteredDuringExSummaryOfMeansArray = []
MeanOutputHeader=['TestID','ConditionName','FilterType','RRMean','HRMean',
'dZdtMaxVoltageMean','BZMean','ZXMean','LVETMean','Z0Mean',
'StrokeVolumeMean','CardiacOutputMean','VelocityIndexMean']
dataMatrix = BeatByBeatMatrixOfMatrices[column]
roughTrimmedMatrix = p.array(dataMatrix[1:,1:17])
trimmedMatrix = p.array(roughTrimmedMatrix,dtype=p.float64) #ERROR THROWN HERE
myMeans = p.mean(trimmedMatrix,axis=0,dtype=p.float64)
conditionMeansArray = [TestID,testCondition,'UnfilteredBefore',myMeans[3], myMeans[4],
myMeans[6], myMeans[9], myMeans[10], myMeans[11], myMeans[12],
myMeans[13], myMeans[14], myMeans[15]]
UnFilteredDuringExSummaryOfMeansArray.append(conditionMeansArray)
secondfunction(UnFilteredDuringExSummaryOfMeansArray)
return
def secondfunction(UnFilteredDuringExSummaryOfMeansArray):
RRDuringArray = p.array(UnFilteredDuringExSummaryOfMeansArray,dtype=p.float64)[1:,3]
return
firstfunction()
Can someone explain to me how to fix this problem?