Re: numpy question (fairly basic, I think)

2014-12-14 Thread Gregory Ewing
Albert-Jan Roskam wrote: I was trying to change the one-dim array into a two-dim array so I could easily retrieve columns. I now use a pandas DataFrame to do that. Numpy can do that, if I understand what you want correctly, but it requires an unintuitive trick. The trick is to index the array

Re: numpy question (fairly basic, I think)

2014-12-14 Thread Albert-Jan Roskam
- Original Message - > From: Steven D'Aprano > To: python-list@python.org > Cc: > Sent: Sunday, December 14, 2014 12:52 AM > Subject: Re: numpy question (fairly basic, I think) > > Albert-Jan Roskam wrote: > >> Hi, >> >> I am new to

Re: numpy question (fairly basic, I think)

2014-12-13 Thread Steven D'Aprano
Albert-Jan Roskam wrote: > Hi, > > I am new to numpy. I am reading binary data one record at a time (I have > to) and I would like to store all the records in a numpy array which I > pre-allocate. Below I try to fill the empty array with exactly one record, > but it is filled with as many rows as

numpy question (fairly basic, I think)

2014-12-13 Thread Albert-Jan Roskam
Hi, I am new to numpy. I am reading binary data one record at a time (I have to) and I would like to store all the records in a numpy array which I pre-allocate. Below I try to fill the empty array with exactly one record, but it is filled with as many rows as there are columns. Why is this? It