<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Thanks - very cool!<br>
    <br>
    On 10/01/2012 21:45, Val Kalatsky wrote:
    <blockquote
cite="mid:CAE8bXE=9FpyopC7DydcAwdMRyr-YAyP5i-8ZzGKfqS6crfvGhQ@mail.gmail.com"
      type="cite">
      <div><br>
      </div>
      A - np.digitize(A, S)&nbsp;
      <div>Should do the trick, just make sure that S is sorted and A
        and S do not overlap,&nbsp;</div>
      <div>if they do remove those items from A using set operations.</div>
      <div>Val<br>
        <br>
        <div class="gmail_quote">
          On Tue, Jan 10, 2012 at 2:14 PM, Mads Ipsen <span dir="ltr">&lt;<a
              moz-do-not-send="true" href="mailto:madsipsen@gmail.com">madsipsen@gmail.com</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
            0.8ex; border-left: 1px solid rgb(204, 204, 204);
            padding-left: 1ex;">
            <div bgcolor="#ffffff" text="#000000"> <font
                face="Bitstream Vera Sans Mono">Hi,<br>
                <br>
                Suppose you have N items, say N = 10. <br>
                <br>
                Now a subset of these items are selected given by a list
                A of indices. Lets say that items A = [2,5,7] are
                selected. Assume now that you delete some of the items
                given by the indices S = [1,4,8]. This means that the
                list of indices A must be updated, since items have been
                deleted. For this particular case the updated selection
                list A becomes A = [1,3,5]. <br>
                <br>
                Is there some smart numpy way of doing this index update
                of the selected items in A without looping? Typically N
                is large.<br>
                <br>
                Best regards,<br>
                <br>
                Mads<span class="HOEnZb"><font color="#888888"><br>
                  </font></span></font><span class="HOEnZb"><font
                  color="#888888">
                  <pre cols="72">-- 
+-----------------------------------------------------+
| Mads Ipsen                                          |
+----------------------+------------------------------+
| G&aring;seb&aelig;ksvej 7, 4. tv |                              |
| DK-2500 Valby        | phone:          <a moz-do-not-send="true" href="tel:%2B45-29716388" value="+4529716388" target="_blank">+45-29716388</a> |
| Denmark              | email:  <a moz-do-not-send="true" href="mailto:mads.ipsen@gmail.com" target="_blank">mads.ipsen@gmail.com</a> |
+----------------------+------------------------------+

</pre>
                </font></span></div>
            <br>
            _______________________________________________<br>
            NumPy-Discussion mailing list<br>
            <a moz-do-not-send="true"
              href="mailto:NumPy-Discussion@scipy.org">NumPy-Discussion@scipy.org</a><br>
            <a moz-do-not-send="true"
              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>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
NumPy-Discussion mailing list
<a class="moz-txt-link-abbreviated" href="mailto:NumPy-Discussion@scipy.org">NumPy-Discussion@scipy.org</a>
<a class="moz-txt-link-freetext" href="http://mail.scipy.org/mailman/listinfo/numpy-discussion">http://mail.scipy.org/mailman/listinfo/numpy-discussion</a>
</pre>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
+-----------------------------------------------------+
| Mads Ipsen                                          |
+----------------------+------------------------------+
| G&aring;seb&aelig;ksvej 7, 4. tv |                              |
| DK-2500 Valby        | phone:          +45-29716388 |
| Denmark              | email:  <a class="moz-txt-link-abbreviated" href="mailto:mads.ipsen@gmail.com">mads.ipsen@gmail.com</a> |
+----------------------+------------------------------+

</pre>
  </body>
</html>