Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 numpy.where array search for string in just one coordinate
#1
I have the following array:
[[  258 16892 40056]
 [  259 25647 40056]
 [  260 25847 40056]
 [  261 47339 259]]
I want to search in it and find rows where just the first element == 259.
This call will find it twice in row 1 and row 3:
np.where(intArrayFromLine == 259 )
How do I compose the np.where (or other call) so that it only looks in the first column - ie so it would find just row 1 ?
thans
Quote
#2
np.where(intArrayFromLine[:,0] == 259)
the "0" is for the 1rst column
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  memory issue loading movie to numpy array djf123 1 134 Nov-07-2019, 06:19 AM
Last Post: ThomasL
  Numpy structured array Nitram 3 329 Sep-17-2019, 10:09 PM
Last Post: jefsummers
  numpy.copy / numpy.delete paul18fr 3 376 Jul-26-2019, 01:51 PM
Last Post: paul18fr
  AttributeError: module 'numpy' has no attribute 'array aapurdel 7 7,222 May-29-2019, 02:48 AM
Last Post: heiner55
  Array in numpy Truman 5 4,388 May-26-2019, 10:14 AM
Last Post: snippsat
  [split] Array in numpy aapurdel 1 355 May-25-2019, 08:05 PM
Last Post: buran
  [numpy]add a value to an array elmismo999 1 504 May-23-2019, 04:15 PM
Last Post: michalmonday
  "erlarge" a numpy-matrix to numpy-array PhysChem 2 502 Apr-09-2019, 04:54 PM
Last Post: PhysChem
  while creating a array using numpy.arrange, how to negate only the last 50 numbers? vicky53 1 514 Apr-06-2019, 11:52 AM
Last Post: scidam
  How to get the size of a numpy array? mcgrim 2 550 Mar-23-2019, 02:25 PM
Last Post: perfringo

Forum Jump:


Users browsing this thread: 1 Guest(s)