code: def calculate_cat_num_assoc_matrix(
      data, categorical_variables, numerical_variables, n
  ):
      from scipy.stats import kruskal
  
      cat_num_assoc_matrix = pd.DataFrame(
          index=categorical_variables,
          columns=numerical_variables,
          dtype=float,
      )
      for cat_variable_name in categorical_variables:
          for num_variable_name in numerical_variables:
              # calculate eta-squared
              samples = [
                  gr_data[num_variable_name].values
                  for gr_name, gr_data in data.groupby(
                      cat_variable_name, as_index=False
                  )
              ]
              kruskal_wallis_test = kruskal(*samples, nan_policy="omit")
              n_samples = len(samples)
              eta_squared = (
                  kruskal_wallis_test.statistic - n_samples + 1
              ) / (n - n_samples)
              eta_squared = checks.check_assoc_value(eta_squared)
              cat_num_assoc_matrix.loc[
                  cat_variable_name, num_variable_name
              ] = eta_squared
      return cat_num_assoc_matrix
  
file_path: DALEX/python/dalex/dalex/aspect/utils.py
imports: import numpy
  import pandas
  import warnings
  from .None import checks
  from ..None import _global_checks
label_desc: Use image node_id 2 for calling a global function with example usage: calculate_cat_num_assoc_matrix(data, categorical_variables, numerical_variables, n) and returns: cat_num_assoc_matrix