original_docstring: Create a dict to store the results for plotting.
  
      Args:
          parameters: see k_means.utils.mapping.Parameters for more details.
          data_eng: see k_means.core.data_prep.DataEng for more details.
          counter: the iteration number.
  
      Returns:
          results_iter: dict of results used in plotting the simulation.
      
docstring: Create a dict to store the results for plotting.
docstring_tokens: Create a dict to store the results for plotting .
code: def append_to_results(parameters: Parameters,
                        data_eng: DataEng,
                        counter: int) -> Dict[any, any]:
      """Create a dict to store the results for plotting.
  
      Args:
          parameters: see k_means.utils.mapping.Parameters for more details.
          data_eng: see k_means.core.data_prep.DataEng for more details.
          counter: the iteration number.
  
      Returns:
          results_iter: dict of results used in plotting the simulation.
      """
      results_iter = {
          'iteration': counter,
          'cluster_plots': [],
          'new_centroids': {}
      }
      try:
          for i in range(parameters.num_clusters):
              results_iter['cluster_plots'].append({
                  'plot_x_' + str(i + 1): np.array(data_eng.clusters[i])[:, 0],
                  'plot_y_' + str(i + 1): np.array(data_eng.clusters[i])[:, 1],
                  'plot_c_' + str(i + 1): data_eng.colours[i],
                  'plot_label_' + str(i + 1): 'Cluster ' + str(i + 1)
              })
          # add new centroids to results
          results_iter['new_centroids']['x'] = data_eng.centroids_new[:, 0]
          results_iter['new_centroids']['y'] = data_eng.centroids_new[:, 1]
          results_iter['new_centroids']['c'] = 'r'
          results_iter['new_centroids']['marker'] = '*'
          results_iter['new_centroids']['s'] = 200
          results_iter['new_centroids']['label'] = 'Centroids Iter ' + str(counter + 1)
      except IndexError as index_expt:
          print_detailed_exception(currentframe().f_code.co_name, sys.exc_info(), index_expt)
      return results_iter
code_tokens: def append_to_results ( parameters : Parameters , data_eng : DataEng , counter : int ) -> Dict [ any , any ] : results_iter = { 'iteration' : counter , 'cluster_plots' : [ ] , 'new_centroids' : { } } try : for i in range ( parameters . num_clusters ) : results_iter [ 'cluster_plots' ] . append ( { 'plot_x_' + str ( i + 1 ) : np . array ( data_eng . clusters [ i ] ) [ : , 0 ] , 'plot_y_' + str ( i + 1 ) : np . array ( data_eng . clusters [ i ] ) [ : , 1 ] , 'plot_c_' + str ( i + 1 ) : data_eng . colours [ i ] , 'plot_label_' + str ( i + 1 ) : 'Cluster ' + str ( i + 1 ) } ) results_iter [ 'new_centroids' ] [ 'x' ] = data_eng . centroids_new [ : , 0 ] results_iter [ 'new_centroids' ] [ 'y' ] = data_eng . centroids_new [ : , 1 ] results_iter [ 'new_centroids' ] [ 'c' ] = 'r' results_iter [ 'new_centroids' ] [ 'marker' ] = '*' results_iter [ 'new_centroids' ] [ 's' ] = 200 results_iter [ 'new_centroids' ] [ 'label' ] = 'Centroids Iter ' + str ( counter + 1 ) except IndexError as index_expt : print_detailed_exception ( currentframe ( ) . f_code . co_name , sys . exc_info ( ) , index_expt ) return results_iter
short_docstring: Create a dict to store the results for plotting.
short_docstring_tokens: Create a dict to store the results for plotting .
comment: """Create a dict to store the results for plotting.
  
      Args:
          parameters: see k_means.utils.mapping.Parameters for more details.
          data_eng: see k_means.core.data_prep.DataEng for more details.
          counter: the iteration number.
  
      Returns:
          results_iter: dict of results used in plotting the simulation.
      """$SEP$# add new centroids to results