class_docstr: A data interface for private data with meta information.
class_docstr_tok: ["A","data","interface","for","private","data","with","meta","information","."]
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.categorical_levels[cat_feature])
  
      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 collections
  import logging
  import sys
  from collections import defaultdict
  import numpy
  import pandas
  from sklearn.preprocessing import LabelEncoder
  from dice_ml.data_interfaces.base_data_interface import _BaseData
label_desc: Use image node_id 20 for calling the PrivateData obj's underlying member method code with example usage: obj.prepare_df_for_ohe_encoding() and returns: df