class_docstr: A class to store and visualize the resulting counterfactual explanations.
class_docstr_tok: ["A","class","to","store","and","visualize","the","resulting","counterfactual","explanations","."]
code: def display_df(self, df, show_only_changes):
      from IPython.display import display
  
      if show_only_changes is False:
          display(df)  # works only in Jupyter notebook
      else:
          newdf = df.values.tolist()
          org = self.test_instance_df.values.tolist()[0]
          for ix in range(df.shape[0]):
              for jx in range(len(org)):
                  if not isinstance(newdf[ix][jx], str):
                      if math.isclose(
                          newdf[ix][jx],
                          org[jx],
                          rel_tol=abs(org[jx] / 10000),
                      ):
                          newdf[ix][jx] = "-"
                      else:
                          newdf[ix][jx] = str(newdf[ix][jx])
                  else:
                      if newdf[ix][jx] == org[jx]:
                          newdf[ix][jx] = "-"
                      else:
                          newdf[ix][jx] = str(newdf[ix][jx])
          display(
              pd.DataFrame(newdf, columns=df.columns, index=df.index)
          )
  
imports: import copy
  import json
  import math
  import numpy
  import pandas
  from dice_ml.constants import ModelTypes, _SchemaVersions
  from dice_ml.utils.serialize import DummyDataInterface
label_desc: Use image node_id 6 for calling the CounterfactualExamples obj's underlying member method code with example usage: obj.display_df(df, show_only_changes) without return types