Re: array of array of float

2006-07-12 Thread Fredrik Lundh
"Schüle Daniel" wrote: > > a = [[] for in range(200)] > > correction :) > > a = [[] for i in range(200)] the "*500" part still seems to be missing... -- http://mail.python.org/mailman/listinfo/python-list

Re: array of array of float

2006-07-09 Thread tac-tics
Use nested list comprehensions: matrix = [[0.0 for x in xrange(n)] for y in xrange(m)] This is similar to "float matrix[m][n]" in C. All cells are independent of each other in doing this. -- http://mail.python.org/mailman/listinfo/python-list

Re: array of array of float

2006-07-09 Thread Schüle Daniel
Schüle Daniel schrieb: > [EMAIL PROTECTED] schrieb: >> i used C too much and haven't used Python for a while... >> >> like in C, if we want an array of array of float, we use >> >> float a[200][500]; >> >> now in Python, seems like we have to d

Re: array of array of float

2006-07-09 Thread Schüle Daniel
[EMAIL PROTECTED] schrieb: > i used C too much and haven't used Python for a while... > > like in C, if we want an array of array of float, we use > > float a[200][500]; > > now in Python, seems like we have to do something like > > a = [ [ ] ] * 200 > &

Re: array of array of float

2006-07-09 Thread DH
[EMAIL PROTECTED] wrote: > i used C too much and haven't used Python for a while... > > like in C, if we want an array of array of float, we use > > float a[200][500]; > > now in Python, seems like we have to do something like > > a = [ [ ] ] * 200 > > an

Re: array of array of float

2006-07-09 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > i used C too much and haven't used Python for a while... > > like in C, if we want an array of array of float, we use > > float a[200][500]; > > now in Python, seems like we have to do something like > > a = [ [ ] ] * 200 > &

array of array of float

2006-07-09 Thread Summercoolness
i used C too much and haven't used Python for a while... like in C, if we want an array of array of float, we use float a[200][500]; now in Python, seems like we have to do something like a = [ [ ] ] * 200 and then just use a[1].append(12.34) etc but it turns out that all 200 ele