0
合并数组我有8个数据的每个具有在所述循环的结束列和长度在列表蟒
file=glob.glob('*.txt')
x=0
plotnum=1
LL=[]
for f in file:
A=np.loadtxt(f, skiprows=2, usecols=[0]) #column with area data
L=np.loadtxt(f, skiprows=2, usecols=[1]) #column with length data
.......#code that plots subplots, calculates best fit lines, prints equations etc
LL.append(L)
plotnum+=1
x+=1
文件当我打印LL它打印出阵列的列表。我需要计算所有数据的标准差,但是这显示了一个错误,当我键入:
np.std(LL)
是有办法合并所有的数组到一个单一的列表,以便我可以再计算出标准偏差?
猪头...您可以显示错误? – Milor123
'np.std(LL) 回溯(最近通话最后一个): 文件 “”,1号线,在 文件 “C:\ Python27 \ LIB \站点包\ numpy的\核心\ fromnumeric.py” ,line 2836,std keepdims = keepdims) 文件“C:\ Python27 \ lib \ site-packages \ numpy \ core \ _methods.py”,第125行,在_std keepdims = keepdims) 文件“C:\ Python27 \ lib \ site-packages \ numpy \ core \ _methods.py“,第92行,_var arrmean = umr_sum(arr,axis,dtype,keepdims = True) ValueError:操作数无法与形状一起广播,)(93,)' –
Rcoder
并且也希望看到一个打印LL – Milor123