class_docstr: Imputed Data
  
  This class should not be instantiated directly.
  Instead, it is returned when ImputationKernel.impute_new_data() is called.
  For parameter arguments, see ImputationKernel documentation.
class_docstr_tok: ["Imputed","Data","This","class","should","not","be","instantiated","directly",".","Instead",",","it","is","returned","when","ImputationKernel.impute_new_data","(",")","is","called",".","For","parameter","arguments",",","see","ImputationKernel","documentation","."]
docstr: Return the correlations between datasets for
  the specified variables.
  
  Parameters
  ----------
  variables: list[str], list[int]
      The variables to return the correlations for.
  
  Returns
  -------
  dict
      The correlations at each iteration for the specified
      variables.
docstr_tok: ["Return","the","correlations","between","datasets","for","the","specified","variables",".","Parameters","--","--","--","--","--","variables",":","list","[","str","]",",","list","[","int","]","The","variables","to","return","the","correlations","for",".","Returns","--","--","--","-","dict","The","correlations","at","each","iteration","for","the","specified","variables","."]
code: def get_correlations(
      self, datasets: List[int], variables: Union[List[int], List[str]]
  ):
      """
      Return the correlations between datasets for
      the specified variables.
  
      Parameters
      ----------
      variables: list[str], list[int]
          The variables to return the correlations for.
  
      Returns
      -------
      dict
          The correlations at each iteration for the specified
          variables.
  
      """
  
      if self.dataset_count() < 3:
          raise ValueError(
              "Not enough datasets to calculate correlations between them"
          )
      curr_iteration = self.iteration_count()
      var_indx = self._get_var_ind_from_list(variables)
  
      # For every variable, get the correlations between every dataset combination
      # at each iteration
      correlation_dict = {}
      if self.save_all_iterations:
          iter_range = list(range(1, curr_iteration + 1))
      else:
          # Make this iterable for code tidyness
          iter_range = [curr_iteration]
  
      for var in var_indx:
          # Get a dict of variables and imputations for all datasets for this iteration
          iteration_level_imputations = {
              iteration: {
                  ds: self[ds, var, iteration] for ds in datasets
              }
              for iteration in iter_range
          }
  
          combination_correlations = {
              iteration: [
                  round(np.corrcoef(impcomb)[0, 1], 3)
                  for impcomb in list(combinations(varimps.values(), 2))
              ]
              for iteration, varimps in iteration_level_imputations.items()
          }
  
          correlation_dict[var] = combination_correlations
  
      return correlation_dict
  
imports: import numpy
  from .compat import pd_DataFrame
  from .utils import _t_dat, _t_var_list, _t_var_dict, _ensure_iterable, _dict_set_diff, _assign_col_values_without_copy, _slice, _subset_data
  from itertools import combinations
  from typing import Dict, List, Union, Any, Optional
  from warnings import warn
label_desc: Use image node_id 23 for calling the ImputedData obj's underlying member method code with example usage: obj.get_correlations(datasets, variables) and returns: correlation_dict