else:
clusters = pd.DataFrame(group_ids)
cov_config_upd["clusters"] = clusters.values if clusters is not None else clusters
return cov_est, cov_config_upd
After Change
if clusters is not None:
clusters = self.reformat_clusters(clusters).copy()
for col in clusters.dataframe:
cat = pd.Categorical(clusters.dataframe[col])
clusters.dataframe[col] = cat.codes.astype(np.int64)
clusters = clusters.dataframe
cluster_entity = cov_config_upd.pop("cluster_entity", False)