class_docstr: A data interface for public data. This class is an interface to DiCE explainers
  and contains methods to transform user-fed raw data into the format a DiCE explainer
  requires, and vice versa.
class_docstr_tok: ["A","data","interface","for","public","data",".","This","class","is","an","interface","to","DiCE","explainers","and","contains","methods","to","transform","user-fed","raw","data","into","the","format","a","DiCE","explainer","requires",",","and","vice","versa","."]
docstr: Create base dataframe to do OHE for a single instance or a set of instances
docstr_tok: ["Create","base","dataframe","to","do","OHE","for","a","single","instance","or","a","set","of","instances"]
code: def prepare_df_for_ohe_encoding(self):
      """Create base dataframe to do OHE for a single instance or a set of instances"""
      levels = []
      colnames = [feat for feat in self.categorical_feature_names]
      for cat_feature in colnames:
          levels.append(
              self.data_df[cat_feature].cat.categories.tolist()
          )
  
      if len(colnames) > 0:
          df = pd.DataFrame({colnames[0]: levels[0]})
      else:
          df = pd.DataFrame()
  
      for col in range(1, len(colnames)):
          temp_df = pd.DataFrame({colnames[col]: levels[col]})
          df = pd.concat([df, temp_df], axis=1, sort=False)
  
      colnames = [feat for feat in self.continuous_feature_names]
      for col in range(0, len(colnames)):
          temp_df = pd.DataFrame({colnames[col]: []})
          df = pd.concat([df, temp_df], axis=1, sort=False)
  
      return df
  
imports: import logging
  from collections import defaultdict
  import numpy
  import pandas
  from raiutils.exceptions import UserConfigValidationException
  from sklearn.preprocessing import LabelEncoder
  from dice_ml.data_interfaces.base_data_interface import _BaseData
  from dice_ml.utils.exception import SystemException
label_desc: Use image node_id 25 for calling the PublicData obj's underlying member method code with example usage: obj.prepare_df_for_ohe_encoding() and returns: df