title: Losing results from a triple for loop
body: <p>I' m trying to do some matches between an np.array and some folders/images I have.
  I' m positive that i have created a 1 to 1 match for all my data.
  So I' m guessing I lose results from the way my for loops are structured, don't know why though.</p>
  <p>My np.array has the following structure (ArtistName, Song, Sentiment):</p>
  <ol>
  <li>['Singer1' 'song1' 'Sad']</li>
  <li>['Singer1' 'song2' 'Excited']</li>
  <li>['Singer2' 'song1' 'Sad']</li>
  <li>['Singer2' 'song2' 'Afraid']</li>
  <li>...</li>
  <li>['Singer5229' 'song25' 'Afraid']</li>
  </ol>
  <p>etc, aggregated to 5229 registries</p>
  <p>My folders' names have the artists' names and inside those folders are images (spectograms) named after the songs.
  My aim is to match 1 to 1 the registries so I can create my X,y tables, where X will be an image vector and y the sentiment, so to train a CNN later.
  I lose about 1k of matchings though.
  My code is as follows:</p>
  <pre><code>spectoPath = '/home/mike/Spectograms'
  
  X = []
  y = []
  
  i = 0
  
  for folder in os.listdir(spectoPath):
    for image in os.listdir(spectoPath + '/' + folder):
      for x in range(len(artistTrackSentiment)):
        if '/' in artistTrackSentiment[x][1]:
          artistTrackSentiment[x][1] = artistTrackSentiment[x][1].replace(&quot;/&quot;, &quot;_&quot;)
        if folder == artistTrackSentiment[x][0] and image == artistTrackSentiment[x][1]+'.png':
          i += 1
          img = cv2.imread(spectoPath + '/' + folder + '/' + image)
          resized_image = cv2.resize(img, (256, 256))
  
          # plt.imshow(resized_image)
  
          X.append(np.asarray(resized_image))
          y.append(artistTrackSentiment[x][2])
          # print(X)
          # print(y)
  
  print(&quot;Matches found&quot;, i)
  </code></pre>