Re: Help me on function definition

2008-04-04 Thread Alan Isaac
aeneng wrote: > WHAT IS WRONG WITH MY CODE? > def cross(u,v) Missing colon. hth, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: Help me on function definition

2008-03-29 Thread castironpi
On Mar 29, 11:45 pm, hdante <[EMAIL PROTECTED]> wrote: > On Mar 28, 10:47 pm, "aeneng" <[EMAIL PROTECTED]> wrote: > > > Hello everyone, > >  Hi, > >  Always avoid reinventing the wheel: > > from Numeric import array, cross_product > a = array([1, 2, 3]) > b = array([4, 5, 6]) > print cross_product(

Re: Help me on function definition

2008-03-29 Thread hdante
On Mar 28, 10:47 pm, "aeneng" <[EMAIL PROTECTED]> wrote: > Hello everyone, Hi, Always avoid reinventing the wheel: from Numeric import array, cross_product a = array([1, 2, 3]) b = array([4, 5, 6]) print cross_product(a, b) See: http://numpy.scipy.org/ http://www.scipy.org/ (hint: consid

Re: Help me on function definition

2008-03-29 Thread Terry Reedy
"aeneng" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | def cross(u,v) |"""input two vectors u and v in 3-D space, | output a cross product of vector w, in column or in row | accordingly.""" |ppp1,ppp2,ppp3=0.0,0.0,0.0 To add to other comments, remove above which is

Re: Help me on function definition

2008-03-29 Thread castironpi
On Mar 29, 4:18 am, Roel Schroeven <[EMAIL PROTECTED]> wrote: > aeneng schreef: > > > > > > > Hello everyone, > > > I am just starting to use python in numerical cacluation. > > I need you to help me to see what's wrong with the following piece of > > codes, which computes the cross product of two

Re: Help me on function definition

2008-03-29 Thread Roel Schroeven
aeneng schreef: > Hello everyone, > > I am just starting to use python in numerical cacluation. > I need you to help me to see what's wrong with the following piece of > codes, which computes the cross product of two vectors and returns > the result. u and v are two 3x1 matrix. > > when I impo

Re: Help me on function definition

2008-03-28 Thread John Machin
On Mar 29, 12:47 pm, "aeneng" <[EMAIL PROTECTED]> wrote: > Hello everyone, > > I am just starting to use python in numerical cacluation. > I need you to help me to see what's wrong with the following piece of > codes, which computes the cross product of two vectors and returns > the result. u and v

Re: Help me on function definition

2008-03-28 Thread Steven D'Aprano
Oh, I forgot to mention... On Sat, 29 Mar 2008 01:47:21 +, aeneng wrote: > if __name__=="__main__": ... > print "file name is %s" %__name__ This doesn't do what you expect it to do. You've already established that __name__ is equal to "__main__", so you might as well change that line

Re: Help me on function definition

2008-03-28 Thread Ben Finney
"aeneng" <[EMAIL PROTECTED]> writes: > I am just starting to use python in numerical cacluation. Welcome, and congratulations on learning Python. > I need you to help me to see what's wrong with the following piece > of codes [...] Your code is rather difficult to read, since your expressions

Re: Help me on function definition

2008-03-28 Thread Steven D'Aprano
On Sat, 29 Mar 2008 01:47:21 +, aeneng wrote: > Hello everyone, > > I am just starting to use python in numerical cacluation. I need you to > help me to see what's wrong with the following piece of codes, which > computes the cross product of two vectors and returns the result. u and > v are

Re: Help me on function definition

2008-03-28 Thread Michael Wieher
No problem... your def needs a colon.. def function(params): yours lacks it =) thats all On Fri, Mar 28, 2008 at 8:47 PM, aeneng <[EMAIL PROTECTED]> wrote: > Hello everyone, > > I am just starting to use python in numerical cacluation. > I need you to help me to see what's wrong with the follo

Help me on function definition

2008-03-28 Thread aeneng
Hello everyone, I am just starting to use python in numerical cacluation. I need you to help me to see what's wrong with the following piece of codes, which computes the cross product of two vectors and returns the result. u and v are two 3x1 matrix. when I import the function, error message s