original_docstring: Find new cluster centroids by taking the mean
          of the data points in the cluster,
          Take the mean of all x points: this is our x of the new centroid,
          Take the mean of all y points: this is our y of the new centroid.
  
      Args:
          parameters: see k_means.utils.mapping.Parameters for more details.
          data_eng: see k_means.core.data_prep.DataEng for more details.
  
      Returns:
          data_eng: since we change the centroids,
              we need to update the data_eng.centroids_new attribute and return data_eng.
      
docstring: Find new cluster centroids by taking the mean
  of the data points in the cluster,
  Take the mean of all x points: this is our x of the new centroid,
  Take the mean of all y points: this is our y of the new centroid.
docstring_tokens: Find new cluster centroids by taking the mean of the data points in the cluster Take the mean of all x points : this is our x of the new centroid Take the mean of all y points : this is our y of the new centroid .
code: def find_new_centroids(parameters: Parameters,
                         data_eng: DataEng) -> DataEng:
      """Find new cluster centroids by taking the mean
          of the data points in the cluster,
          Take the mean of all x points: this is our x of the new centroid,
          Take the mean of all y points: this is our y of the new centroid.
  
      Args:
          parameters: see k_means.utils.mapping.Parameters for more details.
          data_eng: see k_means.core.data_prep.DataEng for more details.
  
      Returns:
          data_eng: since we change the centroids,
              we need to update the data_eng.centroids_new attribute and return data_eng.
      """
      data_eng.centroids_new = data_eng.centroids_prev.copy()
      try:
          for i in range(parameters.num_clusters):
              data_eng.centroids_new[i] = [np.array(data_eng.clusters[i])[:, 0].mean(),
                                           np.array(data_eng.clusters[i])[:, 1].mean()]
      except IndexError as index_expt:
          print_detailed_exception(currentframe().f_code.co_name, sys.exc_info(), index_expt)
      return data_eng
code_tokens: def find_new_centroids ( parameters : Parameters , data_eng : DataEng ) -> DataEng : data_eng . centroids_new = data_eng . centroids_prev . copy ( ) try : for i in range ( parameters . num_clusters ) : data_eng . centroids_new [ i ] = [ np . array ( data_eng . clusters [ i ] ) [ : , 0 ] . mean ( ) , np . array ( data_eng . clusters [ i ] ) [ : , 1 ] . mean ( ) ] except IndexError as index_expt : print_detailed_exception ( currentframe ( ) . f_code . co_name , sys . exc_info ( ) , index_expt ) return data_eng
short_docstring: Find new cluster centroids by taking the mean
  of the data points in the cluster,
  Take the mean of all x points: this is our x of the new centroid,
  Take the mean of all y points: this is our y of the new centroid.
short_docstring_tokens: Find new cluster centroids by taking the mean of the data points in the cluster Take the mean of all x points : this is our x of the new centroid Take the mean of all y points : this is our y of the new centroid .
comment: """Find new cluster centroids by taking the mean
          of the data points in the cluster,
          Take the mean of all x points: this is our x of the new centroid,
          Take the mean of all y points: this is our y of the new centroid.
  
      Args:
          parameters: see k_means.utils.mapping.Parameters for more details.
          data_eng: see k_means.core.data_prep.DataEng for more details.
  
      Returns:
          data_eng: since we change the centroids,
              we need to update the data_eng.centroids_new attribute and return data_eng.
      """