[Numpy-discussion] extract elements of an array that are contained in another array?

josef.pktd@gmai... josef.pktd@gmai...
Thu Jun 4 15:14:59 CDT 2009


On Thu, Jun 4, 2009 at 2:58 PM, Alan G Isaac <aisaac@american.edu> wrote:
> On 6/4/2009 1:27 PM josef.pktd@gmail.com apparently wrote:
>> Note: there are two versions of the docs for np.intersect1d, the
>> currently published docs which describe the actual behavior (for the
>> non-unique case), and the new docs on the doc editor
>> http://docs.scipy.org/numpy/docs/numpy.lib.arraysetops.intersect1d/
>> that describe the "intended" usage of the functions, which also
>> corresponds closer to the original source docstring
>> (http://docs.scipy.org/numpy/docs/numpy.lib.arraysetops.intersect1d/?revision=-227
>> ). that's my interpretation
>
>
> Again, the distributed docs do *not* describe the actual
> behavior for the non-unique case.  E.g.,
>
>>>> np.intersect1d([1,1,2,3,3,4], [1,4])
> array([1, 1, 3, 4])
>
> Might this is a better example of
> failure than the one in the doc editor?

Thanks, that's a very clear example of a wrong answer,
and it removes the question whether the function makes any sense for
the non-unique case.
I changed the example in the doc editor to this one.

It will hopefully merged with the source at the next update.

Josef


>
> However the doc editor version states that the function
> fails for the non-unique case, so it seems there was a
> documentation bug that is in the process of being fixed.

Yes

>
> Thanks,
> Alan
>
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>


More information about the Numpy-discussion mailing list