Re: Need help vectorizing code

2014-01-18 Thread Kevin K
25 PM UTC-8, Kevin K wrote: > I have some code that I need help vectorizing. > > I want to convert the following to vector form, how can I? I want to get rid > of the inner loop - apparently, it's possible to do so. > > X is an NxD matrix. y is a 1xD vector. > >

Need help vectorizing code

2014-01-18 Thread Kevin K
I have some code that I need help vectorizing. I want to convert the following to vector form, how can I? I want to get rid of the inner loop - apparently, it's possible to do so. X is an NxD matrix. y is a 1xD vector. def foo(X, y, mylambda, N, D, epsilon): ... for j in xrange(D):

Re: File IO Issues, help :(

2008-04-29 Thread Kevin K
On Apr 29, 1:07 am, Kevin K <[EMAIL PROTECTED]> wrote: > On Apr 29, 12:55 am, Peter Otten <[EMAIL PROTECTED]> wrote: > > > > > Kevin K wrote: > > > On Apr 29, 12:38 am, "Eric Wertman" <[EMAIL PROTECTED]> wrote: > > >> chuck in a

Re: File IO Issues, help :(

2008-04-28 Thread Kevin K
On Apr 29, 12:55 am, Peter Otten <[EMAIL PROTECTED]> wrote: > Kevin K wrote: > > On Apr 29, 12:38 am, "Eric Wertman" <[EMAIL PROTECTED]> wrote: > >> chuck in a jsfile.close(). The buffer isn't flushing with what you > >> are doing now. jsfil

Re: File IO Issues, help :(

2008-04-28 Thread Kevin K
On Apr 29, 12:38 am, "Eric Wertman" <[EMAIL PROTECTED]> wrote: > chuck in a jsfile.close(). The buffer isn't flushing with what you > are doing now. jsfile.flush() might work... not sure. Closing and > re-opening the file for sure will help though. > Yeah sorry I forgot to include the close() i

File IO Issues, help :(

2008-04-28 Thread Kevin K
Hey everyone, I'm new to python and am trying to do a little project with it. I'm running into problems writing over a file. I read from the file and loop through for a specfic case in which I change something. After I open and give it opening options (w, r, etc) one of two things happens: either t