[Tutor] problem with saving data in a text file

2013-04-23 Thread 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()$') 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', marke

[Tutor] Retrieving data from a text file

2013-04-09 Thread Debashish Saha
In the following you can see data from a ephemeris.txt file. Now I want to retrieve several columns(say, for example the column starting with 00:00, 27.69 and 44.1) and name the array as x,y,z. What do I have to I tried this x, y, z = numpy.loadtxt("ephemeris.txt", unpack=True) And got this error

[Tutor] how to stop a program in python which is running for long time , I am using windows

2012-02-29 Thread Debashish Saha
___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] how to stop a program in python which is running for long time

2012-02-29 Thread Debashish Saha
___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] problem in plotting circular plates at regular separation

2012-02-14 Thread Debashish Saha
from __future__ import division import numpy from enthought.mayavi import mlab for r in range (1,5): print r pi = numpy.pi cos = numpy.cos sin = numpy.sin dphi, dtheta, dz = pi/250.0, pi/250.0, 0.01 [s,theta]=numpy.mgrid[0.01:r+0.015:.01,0:2*pi+dtheta*1.5:dtheta] x=s*co

[Tutor] problem in ploting cylinders with different colour.

2012-02-14 Thread Debashish Saha
import numpy from enthought.mayavi import mlab #def test_mesh(): #"""A very pretty picture of spherical harmonics translated from #the octaviz example.""" for r in range (1,5): print r pi = numpy.pi cos = numpy.cos sin = numpy.sin dphi, dtheta, dz = pi/250.0, pi/250.0, 0

[Tutor] how to print a string in desired colour

2012-02-12 Thread Debashish Saha
suppose i want to print 'hello world' in color blue.so what to do? i tried print 'hello world','blue' ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] how to stop a running program in python without closing python interface?

2012-02-12 Thread Debashish Saha
actually a i ran a progam in python which is sufficiently large . so i want to stop the execution of the program now . how can i do this? ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman

[Tutor] (no subject)

2012-02-11 Thread Debashish Saha
import numpy as np import matplotlib.pyplot as plt E=[81.97400737666324, 322.0939978589591, 694.5766491226185] V0=1000 a=0.1 def V(x): if x > -a and x < a: return 0 return V0 V=np.vectorize(V) #psi=np.vectorize(psi) x= np.linspace(-1.5*a,1.5*a,100) plt.plot(x,V(x)) plt.xlim(-5*a,5

[Tutor] confusion about scipy

2012-02-08 Thread Debashish Saha
ImportError Traceback (most recent call last) C:\Python27\lib\site-packages\IPython\utils\py3compat.pyc in execfile(fname, glob, loc) 166 else: 167 filename = fname --> 168 exec compile(scripttext, filename, 'exec') in gl

[Tutor] how to change the current working directory path in ipython.

2012-02-08 Thread Debashish Saha
how to change the current working directory path in ipython. my current directory path is pwd Out[2]: u'C:\\Users\\as' now if i want to take the path to a subfolder of above 'C:\\Users\\as', what do i have to do? _

[Tutor] confusion with else command

2012-02-07 Thread Debashish Saha
for i in range(1, 8): print(i) if i==3: break else: print('The for loop is over') Output: 1 2 3 Question: but after breaking the for loop why the else loop could not work? ___ Tutor maillist - Tutor@python.org To unsubscribe or c

[Tutor] (no subject)

2012-02-07 Thread Debashish Saha
for i in range(1, 8): print(i) if i==3: break else: print('The for loop is over') Output: 1 2 3 Question:but after breaking the for loop why the else command could not work? ___ Tutor maillist - Tutor@python.org To unsubscribe or

[Tutor] what is the basic difference

2012-02-06 Thread Debashish Saha
what is the basic difference between the commands import pylab as * import matplotlib.pyplot as plt import numpy as np import numpy as * ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/

[Tutor] ploting of a square well

2012-02-05 Thread Debashish Saha
-- Forwarded message -- From: Debashish Saha Date: Sun, Feb 5, 2012 at 7:08 PM Subject: ploting of a square well To: tutor@python.org from pylab import * x=linspace(1,1000,1) a,b = 10,20 def v(x):    i=5;v0=2    for n in range(1,1+i):        if x>(n-1)*(a+b) and xa+(n-1)

[Tutor] ploting of a square well

2012-02-05 Thread Debashish Saha
from pylab import * x=linspace(1,1000,1) a,b = 10,20 def v(x): i=5;v0=2 for n in range(1,1+i): if x>(n-1)*(a+b) and xa+(n-1)*(a+b) and x<(n)*(a+b) : return v0 #v=vectorize(v) plot(x,v) show() Error: x and y must have same first dimension Question: what is to be edit

[Tutor] (no subject)

2012-02-04 Thread Debashish Saha
*input:* import numpy as np def f(y): return (y/5)*2*(np.pi)*0.2 *results:* f(11) Out[109]: 2.5132741228718345 f(11.0) Out[110]: 2.7646015351590183 *question:* why did i get different values for the same input? ___ Tutor maillist - Tutor@python.

[Tutor] factorial of anumber

2012-02-04 Thread Debashish Saha
*PROGRAM TO FIND FACTORIAL OF A NUMBER(I HAVE WRITTEN IT ON GEDIT)* x=1 n=input('enter a positive integer no:') for i in range(1,1+n): x=x*i print x *ERROR:* enter a positive integer no:--- EOFError

[Tutor] SEE THE QUESTION AT THE BOTTOM

2012-02-03 Thread Debashish Saha
INPUT: *for n in range(2, 1000):* *for x in range(2, n):* *if n % x == 0:* *print n, 'equals', x, '*', n/x* *break* *else:* *# loop fell through without finding a factor* *print n, 'is a prime number'* OUTPUT: 2 is a prime number

[Tutor] (no subject)

2012-02-03 Thread Debashish Saha
what is the basic difference between numpy and pylab? ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor