title: IndexError: index 1 is out of bounds for axis 0 with size 1 while storing the result as a tuple in python
body: <p>I want to store the result in a data-frame in form of a tuple with (predictions, probabilities) in each tags. I can print fine the result at the line:
  print(eachPrediction , " : " , eachProbability)
  I'm getting the error for the line :
      Error message:
          temprow[i+1] = (predictions[i],probabilities[i])
      IndexError: index 1 is out of bounds for axis 0 with size 1</p>
  
  <pre><code>from imageai.Prediction import ImagePrediction
  import os
  import pandas as pd
  import numpy as np
  from PIL import Image
  
  execution_path = os.getcwd()
  pred_array = np.empty((0,6),dtype=object)
  
  TEST_PATH = '/home/guest/Documents/Aikomi'
  for img in os.listdir(TEST_PATH):
      if img.endswith('.jpg'):
          image = Image.open(os.path.join(TEST_PATH, img))
          image = image.convert("RGB")
          image = np.array(image, dtype=np.uint8)
          prediction = ImagePrediction()
          prediction.setModelTypeAsDenseNet()
          prediction.setModelPath(os.path.join(execution_path, "DenseNet.h5"))
          prediction.loadModel()
          predictions, probabilities = prediction.predictImage(os.path.join(TEST_PATH, img), result_count=5 )
          temprow = np.zeros((1,pred_array.shape[1]),dtype=object)
          temprow[0] = img
          for i in range(len(predictions)):
              temprow[i+1] = (predictions[i],probabilities[i])
          for eachPrediction, eachProbability in zip(predictions, probabilities):
              #print(eachPrediction , " : " , eachProbability)
              pred_array = np.append(pred_array,temprow,axis=0)
  df = pd.DataFrame(data=pred_array,columns=['File_name','Tag_1','Tag_2','Tag_3','Tag_4','Tag_5'])    
  print(df)
  df.to_csv('Image_tags.csv')
  </code></pre>