title: python type 'list' doesn't have expected attribute 'tolist'
body: <p>i am coding python in PyCharm and it is giving me this warning:</p>
  
  <pre><code>type 'list' doesn't have expected attribute 'tolist'
  </code></pre>
  
  <p>however I have declared my variable list, and here is my code:</p>
  
  <pre><code>...
  my_list = []
  big_list = []
  i= 0
  count = 0
  
  while i &lt; len(data):
      if data[i][3] &lt; 0:
          i += 1
          continue
      my_list.append([data[i][0], data[i][1], data[i][2], data[i][3]])
  
      if i == len(df) - 1:
          count += 1
          self.myfancyfunction(my_list, count)
          big_list.append(my_list)
  
      elif i &lt; len(data) - 1 and data[i][3] != data[i + 1][3]:
          count += 1
          self.myfancyfunction(my_list, count)
          big_list.append(my_list)
          my_list = []
  
          cluster += 1
      i += 1
  </code></pre>
  
  <p>in the two instances of <code>self.myfancyfunction(my_list, count)</code>, the <code>my_list</code> variable is underlined and shows the above error.</p>
  
  <p>Could you please help to fix this?</p>
  
  <h2>update</h2>
  
  <p>here is my fancy function:</p>
  
  <pre><code>def myfancyfunction(self, array_ls, count):
      dict1 = {}
      dict2 = {}
      array_ls = np.asarray(array_ls)
      array_ls = array_ls[:, 2].astype(int)
  
      self.info_ids.append(array_ls.tolist())
  
      sys.stdout.flush()
  
      with open('myfile.txt', "r") as myfile:        
          for line in myfile:            
              if int(line.split()[0]) in array_ls:
  
                  for element in line.split()[1:]:
  
                      key = element.split(":")[0]
                      value = float(element.split(":")[1])
  
                      if key in self.reference:
                          if not str(key) in dict1:
                              dict1[str(key)] = 1
                              dict2[str(key)] = value
                          else:
                              dict1[str(key)] += 1
                              dict2[str(key)] += value
  
      self.info_freq.append(dict1)
      self.info_vals.append(dict2)
  </code></pre>
  
  <p>I am inside a class and have a couple of functions.</p>