<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Aug 13, 2014 at 5:15 PM, Benjamin Root <span dir="ltr"><<a href="mailto:ben.root@ou.edu" target="_blank">ben.root@ou.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">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.<br>


<br>Personally, while I wasn't a particular fan of "count_unique" because I wouldn't necessarially think of it when needing a contingency table, I do like that it is verb-ish. "table()", in this sense, is not a verb. That said, I am perfectly fine with it if you are fine with the name collision in pylab mode.<br>


</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br></div></div></div></blockquote><div><br><br></div><div>Thanks for pointing that out.  I only changed it to have something that sounded more table-ish, like the Pandas, R and Matlab functions.   I won't update it right now, but if there is interest in putting it into numpy, I'll rename it to avoid the pylab conflict.  Anything along the lines of `crosstab`, `xtable`, etc., would be fine with me.<br>
<br></div><div>Warren<br><br><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">
On Wed, Aug 13, 2014 at 4:57 PM, Warren Weckesser <span dir="ltr"><<a href="mailto:warren.weckesser@gmail.com" target="_blank">warren.weckesser@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Aug 12, 2014 at 12:51 PM, Eelco Hoogendoorn <span dir="ltr"><<a href="mailto:hoogendoorn.eelco@gmail.com" target="_blank">hoogendoorn.eelco@gmail.com</a>></span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>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.<br>




<br>I also agree that the extension you propose here is useful; but ideally, with a little more discussion on these subjects we can converge on an even more comprehensive overhaul</div></div><div class="gmail_extra"><br>



<br>
<div class="gmail_quote"><div><div>On Tue, Aug 12, 2014 at 6:33 PM, Joe Kington <span dir="ltr"><<a href="mailto:joferkington@gmail.com" target="_blank">joferkington@gmail.com</a>></span> wrote:<br></div>
</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div>
<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote"><div>On Tue, Aug 12, 2014 at 11:17 AM, Eelco Hoogendoorn <span dir="ltr"><<a href="mailto:hoogendoorn.eelco@gmail.com" target="_blank">hoogendoorn.eelco@gmail.com</a>></span> wrote:<br>





<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left:1px solid rgb(204,204,204)"><div dir="ltr"><div>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 should be part of the numpy core, a robust set of grouping operations in particular.<br>






<br></div><div>see pastebin here:<br><a href="http://pastebin.com/c5WLWPbp" target="_blank">http://pastebin.com/c5WLWPbp</a></div></div></blockquote></div><div><br><div>On a side note, this is related to a pull request of 
mine from awhile back: <a href="https://github.com/numpy/numpy/pull/3584" target="_blank">https://github.com/numpy/numpy/pull/3584</a><br><br></div>There was a lot of disagreement on the mailing list about what to call a "unique slices along a given axis" function, so I wound up closing the pull request pending more discussion.  <br>





<br></div><div>At any rate, I think it's a useful thing to have in "base" numpy.<br></div></div></div></div>
<br></div></div><div>_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@scipy.org" target="_blank">NumPy-Discussion@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/numpy-discussion" target="_blank">http://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
<br></div></blockquote></div><br></div>
<br>_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@scipy.org" target="_blank">NumPy-Discussion@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/numpy-discussion" target="_blank">http://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
<br></blockquote></div><br><br></div></div></div><div class="gmail_extra">Update: I renamed the function to `table` in the pull request: <a href="https://github.com/numpy/numpy/pull/4958" target="_blank">https://github.com/numpy/numpy/pull/4958</a><span><font color="#888888"><br>



<br><br></font></span></div><span><font color="#888888"><div class="gmail_extra">Warren</div></font></span></div>
<br>_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@scipy.org" target="_blank">NumPy-Discussion@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/numpy-discussion" target="_blank">http://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
<br></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@scipy.org">NumPy-Discussion@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/numpy-discussion" target="_blank">http://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
<br></blockquote></div><br></div></div>