title: Python problem with type error : ""float object cannot be interpreted as integer". Can't return the value of function in "for" loop
body: <p>I need to create function g(n) which gives a sum of range of decimal numbers  from 1 to n (including 1 and n).</p>
  
  <p>And than I have to create a 3x5 matrix which rows and columns are function from g(i*j-2*i^pi), i and j are indexes of rows and columns. This is what I made so far:</p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  
  def g(n):
      return np.sum(range(1,n+1)) 
  
  M = np.ones([3,5])
  
  for i in range(3):
      for j in range(5):
          M[i,j] = g(i*j - 2*i**np.pi)  
  </code></pre>
  
  <p>The main problem is that kernel says 'float' object cannot be interpreted as an integer.</p>
  
  <p>Any help would be great, sorry for my bad english, i would like to say that coding is very new topic to me, so really any help is great. Thanks very much.  </p>