problem with saving data in a text file

D

Debashish Saha

I tried the following:

Am_cor=np.vectorize(Am_cor)

#plt.plot(t, signal, color='blue', label='Original signal')
fig=plt.figure()
plt.xlabel('Time(minute)')
plt.ylabel('$ Re(<E1.E2>)$')
plt.xlim([t[0], t[-1]])
plt.ylim((-.3*a1-a1,a1+.3*a1))
plt.grid()
plt.plot(t,Am_cor(t),'o-',label='with parallax', markersize=2)
plt.legend(loc="best")
plt.show()


f = open("Amp_cor_with_parallax(sd=.001)Ilamda=5.txt", "w")
f.write("# time(minute) \t Amp_cor_with_parallax(sd=.001)
\n") # column names
np.savetxt(f, np.array([t, Am_cor(t)]).T)
f.close()


now the error which I am getting is

166 else:
167 filename = fname
--> 168 exec compile(scripttext, filename, 'exec') in glob, loc
169 else:
170 def execfile(fname, *where):

C:\Users\as\desktop\24_04_13\testing23_04.py in <module>()
191 f = open("Amp_cor_with_parallax(sd=.001)Ilamda=5.txt", "w")
192 f.write("# time(minute) \t
Amp_cor_with_parallax(sd=.001) \n") # column names
--> 193 np.savetxt(f, np.array([t, Am_cor(t)]).T)
194 f.close()
195

error: First argument must be a callable function.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top