你能告诉我我做错了吗?
我创建了如下管道:
import numpy as np
files3 = ['brain-mean1.dat2','brain-mean2.dat2','brain-mean3.dat2']
for x in range(len(files3)):
file = files3[x]
data = np.loadtxt(file)
lat = data[:,0]
lon = data[:,1]
rainR = data[:,2]
rain = [lat,lon,rainR]
rain = np.array(rain)
print('new data')
print(rain)
print('rainfall only')
print(rainR)
if x==0:
agRain = rain
print(type(agRain))
else:
rainR = np.array(rainR)
agRain = np.vstack((agRain, rainR))
print('agRain')
print(agRain)
data1 = agRain.T
print('data1')
print(data1)
np.savetxt('build-mean.dat2',data1,fmt='%9.3f')
我把它放在一些字符串上,但它不起作用。 :(
答案 0 :(得分:1)
这里工作正常,
export class HasString implements PipeTransform {
transform(value: any): any {
let test = value + "1234";
return test;
}
}
@NgModule({
imports: [ BrowserModule, FormsModule ],
declarations: [ App,HasString ],
bootstrap: [ App ]
})
<强> DEMO
强>