Re: [Numpy-discussion] The power of strides - Combinations

2010-12-06 Thread Robert Kern
On Mon, Dec 6, 2010 at 21:51, Benjamin Root wrote: > On Monday, December 6, 2010, Robert Kern wrote: >> On Mon, Dec 6, 2010 at 20:18, Mario Moura wrote: >>> Hi Folks >>> >>> Is it possible some example how deal with strides with combinations, let >>> see: >> >> No, sorry. It is not possible to

Re: [Numpy-discussion] The power of strides - Combinations

2010-12-06 Thread Benjamin Root
On Monday, December 6, 2010, Robert Kern wrote: > On Mon, Dec 6, 2010 at 20:18, Mario Moura wrote: >> Hi Folks >> >> Is it possible some example how deal with strides with combinations, let see: > > No, sorry. It is not possible to generate combinations just using strides. > > -- > Robert Kern >

[Numpy-discussion] fromrecords yields "ValueError: invalid itemsize in generic type tuple"

2010-12-06 Thread Rajat Banerjee
Hi All, I have been using Numpy for a while with great success. I left my little project for a little while (http://web.mit.edu/stardev/cluster/) and now some of my code is broken. I have some Numpy code to create graphs of activity on a cluster with matplotlib. It ran just fine in July / August 2

Re: [Numpy-discussion] The power of strides - Combinations

2010-12-06 Thread Robert Kern
On Mon, Dec 6, 2010 at 20:18, Mario Moura wrote: > Hi Folks > > Is it possible some example how deal with strides with combinations, let see: No, sorry. It is not possible to generate combinations just using strides. -- Robert Kern "I have come to believe that the whole world is an enigma, a h

[Numpy-discussion] The power of strides - Combinations

2010-12-06 Thread Mario Moura
Hi Folks Is it possible some example how deal with strides with combinations, let see: >>> from numpy import * >>> import itertools >>> dt = dtype('i,i,i') >>> a = fromiter(itertools.combinations(range(10),3), dtype=dt, count=-1) >>> a array([(0, 1, 2), (0, 1, 3), (0, 1, 4), (0, 1, 5), (0, 1, 6),

Re: [Numpy-discussion] Can I add rows and columns to recarray?

2010-12-06 Thread Francesc Alted
A Monday 06 December 2010 22:00:29 Wai Yip Tung escrigué: > Thank you for the quick response and Christopher's explanation on the > design background. > > All my tables fit in-memory. I want to explore the data interactively > and relational database is does not provide me a lot of value. > > I w

Re: [Numpy-discussion] Can I add rows and columns to recarray?

2010-12-06 Thread Christopher Barker
On 12/6/10 1:00 PM, Wai Yip Tung wrote: > Thank you for the quick response and Christopher's explanation on the > design background. you're welcome. > But if adding row build a new array, this will lead to O(n^2) complexity. if you are adding a lot of rows one at a time, yes, you can have perfo

Re: [Numpy-discussion] Can I add rows and columns to recarray?

2010-12-06 Thread Wai Yip Tung
Thank you for the quick response and Christopher's explanation on the design background. All my tables fit in-memory. I want to explore the data interactively and relational database is does not provide me a lot of value. I was rolling my own library before I come to numpy. Then I find numpy'

Re: [Numpy-discussion] Can I add rows and columns to recarray?

2010-12-06 Thread Christopher Barker
On 12/6/10 11:00 AM, Benjamin Root wrote: > numpy.lib.recfunctions has a method for easily adding new columns. cool! There is a lot of other nifty- looking stuff in there too. The OP should really take a look. And maybe an appending function is in order, too. -Chris -- Christopher Barker, P

Re: [Numpy-discussion] Can I add rows and columns to recarray?

2010-12-06 Thread Benjamin Root
On Mon, Dec 6, 2010 at 12:26 PM, Christopher Barker wrote: > On 12/5/10 7:56 PM, Wai Yip Tung wrote: > >> I'm fairly new to numpy and I'm trying to figure out the right way to do >> things. Continuing on my question about using recarray as a relation. >> > > note that recarrays (or structured arra

Re: [Numpy-discussion] Can I add rows and columns to recarray?

2010-12-06 Thread Christopher Barker
On 12/5/10 7:56 PM, Wai Yip Tung wrote: I'm fairly new to numpy and I'm trying to figure out the right way to do things. Continuing on my question about using recarray as a relation. note that recarrays (or structured arrays, AFAIK, the difference is atturube access only -- I don't use recarra

[Numpy-discussion] numpy rec array and sorting

2010-12-06 Thread John
Hello, I have been trying two methods for creating a rec array from my data (or a structured array -- I'm still not completely clear on the distinction). In terms of data, you can see what types they are, basically simple (n,1) np.ndarrays. I had to reshape them to (n,1) to get them to work with hs