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
  Adding data in 3D array from 2D numpy array asmasattar 0 317 Jul-23-2020, 10:55 AM
Last Post: asmasattar
  converting dataframe to int numpy array glennford49 1 393 Apr-04-2020, 06:15 AM
Last Post: snippsat
  Replacing sub array in Numpy array ThemePark 5 500 Apr-01-2020, 01:16 PM
Last Post: ThemePark
  How to prepare a NumPy array which include float type array elements subhash 0 322 Mar-02-2020, 06:46 AM
Last Post: subhash
  memory issue loading movie to numpy array djf123 1 403 Nov-07-2019, 06:19 AM
Last Post: ThomasL
  Numpy structured array Nitram 3 698 Sep-17-2019, 10:09 PM
Last Post: jefsummers
  numpy.copy / numpy.delete paul18fr 3 785 Jul-26-2019, 01:51 PM
Last Post: paul18fr
  AttributeError: module 'numpy' has no attribute 'array aapurdel 7 15,603 May-29-2019, 02:48 AM
Last Post: heiner55
  Array in numpy Truman 5 5,145 May-26-2019, 10:14 AM
Last Post: snippsat
  [split] Array in numpy aapurdel 1 616 May-25-2019, 08:05 PM
Last Post: buran

Forum Jump:


Users browsing this thread: 1 Guest(s)