Python Forum
numpy in1d with two simple arrays
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
numpy in1d with two simple arrays
#4
Just tried and everything works fine:

>>> import numpy as np
>>> L = np.array([ 1,  3,  5,  7, 12, 13, 14, 15, 16, 17, 18, 24, 25, 27, 29, 30, 31, 32, 33, 35, 36, 38, 41, 43])
>>> L[np.in1d(L+1, L)]
array([12, 13, 14, 15, 16, 17, 24, 29, 30, 31, 32, 35])
Reply


Messages In This Thread
numpy in1d with two simple arrays - by claw91 - Sep-18-2020, 02:58 PM
RE: numpy in1d with two simple arrays - by scidam - Sep-19-2020, 12:16 AM
RE: numpy in1d with two simple arrays - by claw91 - Sep-21-2020, 09:46 AM
RE: numpy in1d with two simple arrays - by scidam - Sep-21-2020, 12:43 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  problem adding two numpy arrays djf123 2 2,110 Aug-09-2022, 08:31 PM
Last Post: deanhystad
  how to join by stack multiple types in numpy arrays caro 1 1,155 Jun-20-2022, 05:02 PM
Last Post: deanhystad
  numpy.dot() result different with classic computation for large-size arrays geekgeek 5 1,916 Jan-25-2022, 09:45 PM
Last Post: Gribouillis
  Two numpy arrays Sandra2312 1 1,821 Jan-18-2021, 06:10 PM
Last Post: paul18fr
  Type coercion with Numpy arrays Mark17 2 2,544 Jul-24-2020, 02:04 AM
Last Post: scidam
  filling and printing numpy arrays of str pjfarley3 4 3,324 Jun-07-2020, 09:09 PM
Last Post: pjfarley3
  How to concatenate nested numpy arrays? python_newbie09 2 4,808 Apr-16-2019, 07:00 PM
Last Post: python_newbie09

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020