title: Simple code for phi(k) correlation matrix in Python
body: <p>I am looking for a simple way (2 or 3 lines of code) to generate a Phi(k) correlation matrix in Python.
  That should be possible since pandas_profiling is doing it, and it works fine.
  But I want to be able to do it without pandas_profiling which is too heavy and computes things I don't need.</p>
  <p>pandas_profiling is using phik library.
  I tried phik library (didn't find anything else)</p>
  <p>I don't understand the error I got :
  TypeError: sequence item 0: expected str instance, int found</p>
  <p>I have no int in my dataframe.</p>
  <p>Seems like a bug in phik, but then how does pandas profiling do, since it's using it too ?</p>
  <p>What's happening here ?
  Many thanks</p>
  <p>I have this code :</p>
  <pre><code>import numpy as np
  import pandas as pd
  
  import phik
  
  NB_SAMPLES = 200
  NB_VARIABLES = 3
  
  rand_mat = np.random.uniform(low=0.5, high=15, size=(NB_SAMPLES,NB_VARIABLES))
  df = pd.DataFrame(rand_mat)
  df['cat_column'] = pd.cut(df[0], bins=5, labels=['F1','F2','F3','F4','F5'])
  print(df)
  df.phik_matrix()
  </code></pre>
  <p>Result :</p>
  <pre><code>                 0          1          2 cat_column
  0     0.911098   8.549206   9.270484         F1
  1    13.591250   9.161498   5.614470         F5
  2     3.308305   1.589402   5.394675         F1
  3    12.031064   9.968686   7.519628         F5
  4    14.427813   1.533533   2.352659         F5
  ..         ...        ...        ...        ...
  195  10.556285   3.541869   4.804826         F4
  196   5.721784  11.783908  13.104844         F2
  197   7.336637  14.512256  14.993096         F3
  198   4.375895  11.881784   1.129816         F2
  199   0.519900   6.624423   9.239070         F1
  
  [200 rows x 4 columns]
  interval_cols not set, guessing: [0, 1, 2]
  
  ---------------------------------------------------------------------------
  _RemoteTraceback                          Traceback (most recent call last)
  _RemoteTraceback: 
  &quot;&quot;&quot;
  Traceback (most recent call last):
    File &quot;/opt/conda/lib/python3.7/site-packages/joblib/externals/loky/process_executor.py&quot;, line 418, in _process_worker
      r = call_item()
    File &quot;/opt/conda/lib/python3.7/site-packages/joblib/externals/loky/process_executor.py&quot;, line 272, in __call__
      return self.fn(*self.args, **self.kwargs)
    File &quot;/opt/conda/lib/python3.7/site-packages/joblib/_parallel_backends.py&quot;, line 608, in __call__
      return self.func(*args, **kwargs)
    File &quot;/opt/conda/lib/python3.7/site-packages/joblib/parallel.py&quot;, line 256, in __call__
      for func, args, kwargs in self.items]
    File &quot;/opt/conda/lib/python3.7/site-packages/joblib/parallel.py&quot;, line 256, in &lt;listcomp&gt;
      for func, args, kwargs in self.items]
    File &quot;/opt/conda/lib/python3.7/site-packages/phik/phik.py&quot;, line 162, in _calc_phik
      combi = ':'.join(comb)
  TypeError: sequence item 0: expected str instance, int found
  &quot;&quot;&quot;
  
  The above exception was the direct cause of the following exception:
  
  TypeError                                 Traceback (most recent call last)
  &lt;ipython-input-31-398c72b34799&gt; in &lt;module&gt;
       11 df['cat_column'] = pd.cut(df[0], bins=5, labels=['F1','F2','F3','F4','F5'])
       12 print(df)
  ---&gt; 13 df.phik_matrix()
  
  /opt/conda/lib/python3.7/site-packages/phik/phik.py in phik_matrix(df, interval_cols, bins, quantile, noise_correction, dropna, drop_underflow, drop_overflow)
      215     data_binned, binning_dict = bin_data(df_clean, cols=interval_cols_clean, bins=bins, quantile=quantile, retbins=True)
      216     return phik_from_rebinned_df(data_binned, noise_correction, dropna=dropna, drop_underflow=drop_underflow,
  --&gt; 217                                  drop_overflow=drop_overflow)
      218 
      219 
  
  /opt/conda/lib/python3.7/site-packages/phik/phik.py in phik_from_rebinned_df(data_binned, noise_correction, dropna, drop_underflow, drop_overflow)
      145 
      146     phik_list = Parallel(n_jobs=NCORES)(delayed(_calc_phik)(co, data_binned[list(co)], noise_correction)
  --&gt; 147                                         for co in itertools.combinations_with_replacement(data_binned.columns.values, 2))
      148 
      149     phik_overview = create_correlation_overview_table(dict(phik_list))
  
  /opt/conda/lib/python3.7/site-packages/joblib/parallel.py in __call__(self, iterable)
     1015 
     1016             with self._backend.retrieval_context():
  -&gt; 1017                 self.retrieve()
     1018             # Make sure that we get a last message telling us we are done
     1019             elapsed_time = time.time() - self._start_time
  
  /opt/conda/lib/python3.7/site-packages/joblib/parallel.py in retrieve(self)
      907             try:
      908                 if getattr(self._backend, 'supports_timeout', False):
  --&gt; 909                     self._output.extend(job.get(timeout=self.timeout))
      910                 else:
      911                     self._output.extend(job.get())
  
  /opt/conda/lib/python3.7/site-packages/joblib/_parallel_backends.py in wrap_future_result(future, timeout)
      560         AsyncResults.get from multiprocessing.&quot;&quot;&quot;
      561         try:
  --&gt; 562             return future.result(timeout=timeout)
      563         except LokyTimeoutError:
      564             raise TimeoutError()
  
  /opt/conda/lib/python3.7/concurrent/futures/_base.py in result(self, timeout)
      433                 raise CancelledError()
      434             elif self._state == FINISHED:
  --&gt; 435                 return self.__get_result()
      436             else:
      437                 raise TimeoutError()
  
  /opt/conda/lib/python3.7/concurrent/futures/_base.py in __get_result(self)
      382     def __get_result(self):
      383         if self._exception:
  --&gt; 384             raise self._exception
      385         else:
      386             return self._result
  
  TypeError: sequence item 0: expected str instance, int found
  </code></pre>