<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _create_cat_table(self,data):
 """ Create table one for categorical data. Returns table : pandas DataFrame A table summarising the categorical variables. """

        table = self.cat_describe['t1_summary'].copy()
        # add the total count of null values across all levels
        isnull = data[self._categorical].isnull().sum().to_frame(name='isnull')
        isnull.index.rename('variable', inplace=True)
        try:
            table = table.join(isnull)
        except TypeError: # if columns form a CategoricalIndex, need to convert to string first
            table.columns = table.columns.astype(str)
            table = table.join(isnull)

        # add pval column
        if self._pval and self._pval_adjust:
            table = table.join(self._significance_table[['pval (adjusted)','ptest']])
        elif self._pval:
            table = table.join(self._significance_table[['pval','ptest']])

        return table