Re: [Numpy-discussion] New function `count_unique` to generate contingency tables.

2015-01-25 Thread Aldcroft, Thomas
On Tue, Aug 12, 2014 at 12:17 PM, Eelco Hoogendoorn < hoogendoorn.ee...@gmail.com> wrote: > Thanks. Prompted by that stackoverflow question, and similar problems I > had to deal with myself, I started working on a much more general extension > to numpy's functionality in this space. Like you noted

Re: [Numpy-discussion] New function `count_unique` to generate contingency tables.

2015-01-25 Thread Warren Weckesser
On Sun, Jan 25, 2015 at 1:48 PM, Warren Weckesser < warren.weckes...@gmail.com> wrote: > > > On Wed, Aug 13, 2014 at 6:17 PM, Eelco Hoogendoorn < > hoogendoorn.ee...@gmail.com> wrote: > >> Its pretty easy to implement this table functionality and more on top of >> the code I linked above. I still

Re: [Numpy-discussion] New function `count_unique` to generate contingency tables.

2015-01-25 Thread Warren Weckesser
On Wed, Aug 13, 2014 at 6:17 PM, Eelco Hoogendoorn < hoogendoorn.ee...@gmail.com> wrote: > Its pretty easy to implement this table functionality and more on top of > the code I linked above. I still think such a comprehensive overhaul of > arraysetops is worth discussing. > > import numpy as np >

Re: [Numpy-discussion] New function `count_unique` to generate contingency tables.

2014-08-13 Thread Eelco Hoogendoorn
Its pretty easy to implement this table functionality and more on top of the code I linked above. I still think such a comprehensive overhaul of arraysetops is worth discussing. import numpy as np import grouping x = [1, 1, 1, 1, 2, 2, 2, 2, 2] y = [3, 4, 3, 3, 3, 4, 5, 5, 5] z = np.random.randint

Re: [Numpy-discussion] New function `count_unique` to generate contingency tables.

2014-08-13 Thread Warren Weckesser
On Wed, Aug 13, 2014 at 5:15 PM, Benjamin Root wrote: > The ever-wonderful pylab mode in matplotlib has a table function for > plotting a table of text in a plot. If I remember correctly, what would > happen is that matplotlib's table() function will simply obliterate the > numpy's table function

Re: [Numpy-discussion] New function `count_unique` to generate contingency tables.

2014-08-13 Thread Benjamin Root
The ever-wonderful pylab mode in matplotlib has a table function for plotting a table of text in a plot. If I remember correctly, what would happen is that matplotlib's table() function will simply obliterate the numpy's table function. This isn't a show-stopper, I just wanted to point that out. P

Re: [Numpy-discussion] New function `count_unique` to generate contingency tables.

2014-08-13 Thread Warren Weckesser
On Tue, Aug 12, 2014 at 12:51 PM, Eelco Hoogendoorn < hoogendoorn.ee...@gmail.com> wrote: > ah yes, that's also an issue I was trying to deal with. the semantics I > prefer in these type of operators, is (as a default), to have every array > be treated as a sequence of keys, so if calling unique(a

Re: [Numpy-discussion] New function `count_unique` to generate contingency tables.

2014-08-12 Thread Eelco Hoogendoorn
ah yes, that's also an issue I was trying to deal with. the semantics I prefer in these type of operators, is (as a default), to have every array be treated as a sequence of keys, so if calling unique(arr_2d), youd get unique rows, unless you pass axis=None, in which case the array is flattened. I

Re: [Numpy-discussion] New function `count_unique` to generate contingency tables.

2014-08-12 Thread Joe Kington
On Tue, Aug 12, 2014 at 11:17 AM, Eelco Hoogendoorn < hoogendoorn.ee...@gmail.com> wrote: > Thanks. Prompted by that stackoverflow question, and similar problems I > had to deal with myself, I started working on a much more general extension > to numpy's functionality in this space. Like you noted

Re: [Numpy-discussion] New function `count_unique` to generate contingency tables.

2014-08-12 Thread Eelco Hoogendoorn
Thanks. Prompted by that stackoverflow question, and similar problems I had to deal with myself, I started working on a much more general extension to numpy's functionality in this space. Like you noted, things get a little panda-y, but I think there is a lot of panda's functionality that could or

Re: [Numpy-discussion] New function `count_unique` to generate contingency tables.

2014-08-12 Thread Warren Weckesser
On Tue, Aug 12, 2014 at 11:35 AM, Warren Weckesser < warren.weckes...@gmail.com> wrote: > I created a pull request (https://github.com/numpy/numpy/pull/4958) that > defines the function `count_unique`. `count_unique` generates a > contingency table from a collection of sequences. For example, >

[Numpy-discussion] New function `count_unique` to generate contingency tables.

2014-08-12 Thread Warren Weckesser
I created a pull request (https://github.com/numpy/numpy/pull/4958) that defines the function `count_unique`. `count_unique` generates a contingency table from a collection of sequences. For example, In [7]: x = [1, 1, 1, 1, 2, 2, 2, 2, 2] In [8]: y = [3, 4, 3, 3, 3, 4, 5, 5, 5] In [9]: (xvals