title: IndexError: index 8 is out of bounds for axis 0 with size 8
body: <p>I was trying to write a code to show the stock available(stock_level) for every items.
  But i got an error as mentioned in the title.
  im importing txt file into an array</p>
  
  <pre><code>code,description,stock_level,min_stock,max_stock,buying_price,selling_price
  1,tukul,3,5,25,20.00,25.00
  2,mouse,20,5,25,30.00,35.00
  3,keyboard,2,5,25,30.00,35.00
  4,headphone,20,5,25,100.00,105.00
  5,monitor,1,5,25,150.00,155.00
  6,cpu,20,5,25,700.00,705.00
  7,casing,20,5,25,100.00,105.00
  </code></pre>
  
  <p>here is my code so far:</p>
  
  <pre><code>import numpy as np
  import csv
  
  list = np.zeros((7,8),dtype = str)
  a = np.genfromtxt('stock.txt',delimiter = ',',dtype = str)
  #print(a)
  
  class stock:
  
      def __init__(self, code, description, stock_level, min_stock, max_stock, buying_price, selling_price):
  
          self.code = code
          self.description = description
          self.stock_level = stock_level
  
          self.min_stock = min_stock
          self.max_stock = max_stock
          self.buying_price = buying_price
          self.selling_price = selling_price
  
      def sell(stock):
  
          i = 0
          while i &lt; 7:
              for r in a:
                  r = 1
                  for c in a:
                      print(a[r][1]," have ", a[r][2]," of stocks")
                      r += 1
              i += 1
  
  disp = stock("","",0,0,0,0,0)
  disp.display()
  #disp.buy()
  #disp.buy()
  disp.sell()
  </code></pre>
  
  <p>the problem is in function sell()</p>
  
  <p>here is the output that i got:</p>
  
  <pre><code>tukul  have  3  of stocks
  mouse  have  20  of stocks
  keyboard  have  2  of stocks
  headphone  have  20  of stocks
  monitor  have  1  of stocks
  cpu  have  20  of stocks
  casing  have  20  of stocks
  Traceback (most recent call last):
    File "D:\OOP\Python\Kiosk\main.py", line 72, in &lt;module&gt;
      disp.sell()
    File "D:\OOP\Python\Kiosk\main.py", line 64, in sell
      print(a[r+1][1]," have ", a[r+1][2]," of stocks")
  IndexError: index 8 is out of bounds for axis 0 with size 8
  &gt;&gt;
  </code></pre>
  
  <p>i do got the result that i want which list of stock available for every items. But i dont know what cause the error </p>