title: How to save tiff images into a new npy file?
body: <p>I would like to save some tiff images I have into a new npy file.</p>
  <p>My data are saved in 5 different files (tiff format). I want to access to each one of them, convert them in narray and then save them in a new npy file (for deep learning classification).</p>
  <pre><code>import numpy as np 
  from PIL import Image
  import os
  
  Data_dir = r&quot;C:\Desktop\Université_2019_2020\CoursS2_Mosef\Stage\Data\Grand_Leez\shp\imagettes&quot;
  Categories = [&quot;Bouleau_tiff&quot;, &quot;Chene_tiff&quot;, &quot;Erable_tiff&quot;, &quot;Frene_tiff&quot;, &quot;Peuplier_tiff&quot;]
  
  for categorie in Categories:
      path = os.path.join(Data_dir, categorie) #path for each species
      for img in os.listdir(path):
          path_img = os.path.join(path,img)
          im = Image.open(os.path.join(path_img)) #load an image file
          imarray = np.array(im) # convert it to a matrix
          imarray = np.delete(imarray, 3, axis=2)
          np.save(Data_dir, imarray)
  </code></pre>
  <p>Problem: It's only return me the last observation of my last category <code>&quot;Peuplier_tiff&quot;</code>, also it's saved into the name <code>imagette</code>, I don't know why.</p>
  <p>Last but not least, I have a doubt for my targets, how I can be sure that my categories are correctly assign to the corresponding arrays.</p>
  <p>A lot of questions,
  thanks in advance for your help.</p>
  <p>S.V</p>