title: Argument of multiprocess.pool.apply raises error of being non iterable int while it's an int from a loop
body: <p>In a class function I have an iterable function that loops through all vectors of the given input data matrix. I do this by the indices as I keep track which points have been checked and to which cluster they belong. 
  Now I tried to parallelize this and two problems arise:</p>
  
  <pre class="lang-py prettyprint-override"><code>[pool.apply(self.expandcluster, args=i) for i in np.where(self._checked == 0)[0]]
  </code></pre>
  
  <p>Raises an error:</p>
  
  <pre class="lang-py prettyprint-override"><code>TypeError: expandcluster() argument after * must be an iterable, not int
  </code></pre>
  
  <p>So I'm wondering how I can iterate through the function 'expandcluster()' by feeding it the indices of boolean vector which is affected by parallel processes.</p>
  
  <p>Then I also probably need to worry about how the parallel processes affect the vectors. Multiprocessing tutorials/docs are very scarce about this topic however. As you can see I now try to iterate through the function, which does not return any, just changes two vectors. </p>
  
  <pre class="lang-py prettyprint-override"><code>class A():
  
      def _init_(self):
           init stuff...
  
      def fit(self, x):
          self._checked = False * np.array(np.size(X, axis=0))
          pool = mp.Pool(8)
          [pool.apply(self.expandcluster, args=i) for i in p.where(self._checked 
           == 0)[0]]
  
      def expandcluster(self, pointIndice):
          self._checked[pointIndice] = 1
          self._clusterIDs = self.find_points(pointIndice)
  </code></pre>
  
  <p>It's for a special implementation of DBSCAN, an unsupervised clustering algorithm. The reason I structure the dataflow like this is that as I check a single point and it turns out to be a cluster center, I check all surrounding points in the same area. Now I don't have to check those again. 
  I've first implemented the algorithm without parallelization, which works fine. I can use the extra computational power however. The original algorithm runs through a for loop with range(np.size(X, axis=0)).</p>