numpy arrays to python compatible arrays

Martin mdekauwe at gmail.com
Thu Jun 10 18:29:24 EDT 2010


On Jun 10, 9:02 pm, Philip Semanchuk <phi... at semanchuk.com> wrote:
> 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 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 very frequently; Python arrays see very little use outside of  
> numpy.
>
> If you can use a Python list, the .tolist() member of the numpy array  
> object should do the trick.
>
> bye
> P

as Philip said...though I very much doubt you really want to do this?
Why wouldn't you just keep it in a numpy array?



More information about the Python-list mailing list