Re: numpy arrays to python compatible arrays

2010-06-12 Thread Javier Montoya
from np.fromfile and np.cov functions) and would like to convert them to simple python arrays. I was wondering which is the best way to do that? Is there any function to do that? HiJavier, Since you are new to Python I'll ask whether you want to convert Numpy   arrays to Python

numpy arrays to python compatible arrays

2010-06-10 Thread Javier Montoya
Dear all, I'm new to python and have been working with the numpy package. I have some numpy float arrays (obtained from np.fromfile and np.cov functions) and would like to convert them to simple python arrays. I was wondering which is the best way to do that? Is there any function to do

Re: numpy arrays to python compatible arrays

2010-06-10 Thread Philip Semanchuk
On Jun 10, 2010, at 9:58 AM, Javier Montoya wrote: Dear all, I'm new to python and have been working with the numpy package. I have some numpy float arrays (obtained from np.fromfile and np.cov functions) and would like to convert them to simple python arrays. I was wondering which

Re: numpy arrays to python compatible arrays

2010-06-10 Thread Martin
to convert them to simple python arrays. I was wondering which is the best way to do that? Is there any function to do that? Hi Javier, Since you are new to Python I'll ask whether you want to convert Numpy   arrays to Python arrays (as you stated) or Python lists. Python lists   are used

arrays in python

2009-09-23 Thread Rudolf
Can someone tell me how to allocate single and multidimensional arrays in python. I looked online and it says to do the following x = ['1','2','3','4'] However, I want a much larger array like a 100 elements, so I cant possibly do that. I want to allocate an array and then populate it using

Re: arrays in python

2009-09-23 Thread Donn
On Wednesday 23 September 2009 19:14:20 Rudolf wrote: I want to allocate an array and then populate it using a for loop. You don't need to allocate anything, just use the list or dictionary types. l=[] #empty list for x in range(1,500): l.append(x) \d --

Re: arrays in python

2009-09-23 Thread Benjamin Kaplan
On Sep 23, 2009, at 1:16 PM, Rudolf yellowblueyel...@gmail.com wrote: Can someone tell me how to allocate single and multidimensional arrays in python. I looked online and it says to do the following x = ['1','2','3','4'] However, I want a much larger array like a 100 elements, so I cant

Re: arrays in python

2009-09-23 Thread Michel Claveau - MVP
Hi! See: http://docs.python.org/tutorial (section 5) @+ -- MCI -- http://mail.python.org/mailman/listinfo/python-list

Re: arrays in python

2009-09-23 Thread Simon Forman
On Wed, Sep 23, 2009 at 1:14 PM, Rudolf yellowblueyel...@gmail.com wrote: Can someone tell me how to allocate single and multidimensional arrays in python. I looked online and it says to do the following x = ['1','2','3','4'] However, I want a much larger array like a 100 elements, so I cant

Re: arrays in python

2009-09-23 Thread Simon Forman
On Wed, Sep 23, 2009 at 1:22 PM, Donn donn.in...@gmail.com wrote: On Wednesday 23 September 2009 19:14:20 Rudolf wrote: I want to allocate an array and then populate it using a for loop. You don't need to allocate anything, just use the list or dictionary types. l=[] #empty list for x in

Re: arrays in python

2009-09-23 Thread Ethan Furman
Donn wrote: On Wednesday 23 September 2009 19:14:20 Rudolf wrote: I want to allocate an array and then populate it using a for loop. You don't need to allocate anything, just use the list or dictionary types. l=[] #empty list for x in range(1,500): l.append(x) \d Works great if you

Re: arrays in python

2009-09-23 Thread Donn
On Wednesday 23 September 2009 22:12:24 Ethan Furman wrote: Works great if you want 4,999,999 elements. ;-) Omit the '1' if you want all five million. Yes. Fenceposts always get me :) And I was just reminded that one can: l=range(500) \d -- home: http://otherwise.relics.co.za/ 2D vector

Re: arrays in python

2009-09-23 Thread AggieDan04
On Sep 23, 3:02 pm, Simon Forman sajmik...@gmail.com wrote: On Wed, Sep 23, 2009 at 1:14 PM, Rudolf yellowblueyel...@gmail.com wrote: Can someone tell me how to allocate single and multidimensional arrays in python. I looked online and it says to do the following x = ['1','2','3','4

Re: arrays in python

2009-09-23 Thread Simon Forman
On Wed, Sep 23, 2009 at 10:03 PM, AggieDan04 danb...@yahoo.com wrote: On Sep 23, 3:02 pm, Simon Forman sajmik...@gmail.com wrote: On Wed, Sep 23, 2009 at 1:14 PM, Rudolf yellowblueyel...@gmail.com wrote: Can someone tell me how to allocate single and multidimensional arrays in python. I

Using arrays in Python - problems.

2007-10-23 Thread attackwarningred
Dear All, Hello! I've just started to use Python and its a lovely language! I've previously programmed in Fortran 95 and have just began to use numpy. I'm having a few problems with arrays in Python though and wondered if someone could offer me some advice? I wrote the following

Re: Using arrays in Python - problems.

2007-10-23 Thread marek . rocki
attackwarningred napisa (a): The array F(n) is dynamically allocated earlier on and is sized with reference to shotcount, the number of iterations the model performs. The problem is I can't get something like this to run in Python using numpy, and for the size of the array to be sized

Re: Using arrays in Python - problems.

2007-10-23 Thread Robert Kern
[EMAIL PROTECTED] wrote: attackwarningred napisa (a): The array F(n) is dynamically allocated earlier on and is sized with reference to shotcount, the number of iterations the model performs. The problem is I can't get something like this to run in Python using numpy, and for the size of

Re: Using arrays in Python - problems.

2007-10-23 Thread Duncan Smith
[EMAIL PROTECTED] wrote: attackwarningred napisa (a): The array F(n) is dynamically allocated earlier on and is sized with reference to shotcount, the number of iterations the model performs. The problem is I can't get something like this to run in Python using numpy, and for the size of the

Re: Using arrays in Python - problems.

2007-10-23 Thread attackwarningred
Thanks very much to those who sent me a reply to my array problem! Its now working brilliantly! Best wishes, Gareth. -- [EMAIL PROTECTED] [EMAIL PROTECTED] 665.9238429876 - Number of the Pentium Beast -- http://mail.python.org/mailman/listinfo/python-list

rpy: parsing arrays from python to R

2007-03-27 Thread Frank
Hi, I use rpy on linux to call R functions. Works fine up to the following problem: How to parse arrays (no vectors, that means 2-dimensional) to R without much effort? The following code solves the problem (in two different ways). However, it seems to me that there might be a way to do it more

arrays in python

2006-02-10 Thread Kermit Rose
From: Kermit Rose Date: 02/10/06 17:36:34 To: [EMAIL PROTECTED] Subject: Arrays Hello. I want to write a program in python using integer arrays. I wish to calculate formulas using 200 digit integers. I could not find any documentation in python manual about declaring arrays. I

Re: arrays in python

2006-02-10 Thread Steve Holden
Kermit Rose wrote: From: Kermit Rose Date: 02/10/06 17:36:34 To: [EMAIL PROTECTED] Subject: Arrays Hello. I want to write a program in python using integer arrays. I wish to calculate formulas using 200 digit integers. I could not find any documentation in python manual

Re: arrays in python

2006-02-10 Thread Schüle Daniel
I want to write a program in python using integer arrays. you can :) I wish to calculate formulas using 200 digit integers. no problem I could not find any documentation in python manual about declaring arrays. I searched the internet read here http://diveintopython.org

Re: arrays in python

2006-02-10 Thread Steven D'Aprano
On Fri, 10 Feb 2006 17:50:21 -0500, Kermit Rose wrote: I want to write a program in python using integer arrays. I wish to calculate formulas using 200 digit integers. Must the integers have exactly 200 digits? If you multiply one of these 200-digit integers by ten, should it silently

Re: arrays in python

2006-02-10 Thread plahey
Oh, don't tell me, I love playing guessing games! Don't you mean No no... don't tell me. I'm keen to guess. Sorry, I couldn't resist... :-) (for those who just went huh?, see http://www.aldo.com/sgt/CheeseShoppeSkit.htm) -- http://mail.python.org/mailman/listinfo/python-list

Long integer arrays in Python; how? /Carl

2005-11-28 Thread Carl
I have the following problem import Numeric dim = 1 bits = 32 v = Numeric.zeros((dim, bits), 'l') for j in range(bits): v[0][j] = 1L bits - j - 1 The problem is the last assignment, which is not valid, since the integer is on the right hand side is to large to be

Re: Long integer arrays in Python; how? /Carl

2005-11-28 Thread Robert Kern
Carl wrote: I have the following problem import Numeric dim = 1 bits = 32 v = Numeric.zeros((dim, bits), 'l') for j in range(bits): v[0][j] = 1L bits - j - 1 The problem is the last assignment, which is not valid, since the integer is on the right hand