docstr: data = main_data 
  name = cohort_name 
  var_name = name of the variable to slice/dice 
  operator: >, <, =, >=, <= 
  value = value of the variable 
  
  returns main_data: filtered dataset with just the probabilities
          name: filtered dataset with the condition
docstr_tok: ["data","=","main_data","name","=","cohort_name","var_name","=","name","of","the","variable","to","slice\/dice","operator",":",">",",","<",",","=",",",">","=",",","<","=","value","=","value","of","the","variable","returns","main_data",":","filtered","dataset","with","just","the","probabilities","name",":","filtered","dataset","with","the","condition"]
code: def filtered_dataframe(
      self, df, filter_variable, var_name="", operator="", value=""
  ):
      """
      data = main_data
      name = cohort_name
      var_name = name of the variable to slice/dice
      operator: >, <, =, >=, <=
      value = value of the variable
  
      returns main_data: filtered dataset with just the probabilities
              name: filtered dataset with the condition
      """
      main_dataset = df[filter_variable]
      if (var_name != "") or (operator != "") or (value != ""):
          if len(df[filter_variable]) != 0:
              name = df.query(
                  "{} {} {}".format(var_name, operator, value)
              )[filter_variable]
              condition = str(var_name) + str(operator) + str(value)
              return main_dataset, name, condition
          else:
              pass
      else:
          if len(df[filter_variable]) != 0:
              condition = "All Data"
              return main_dataset, condition
          else:
              pass
  
file_path: explainx/lib/cohort_analysis.py
imports: from imports import *
label_desc: Use image node_id 2 for calling the cohortAnalysis obj's underlying member method code with example usage: obj.filtered_dataframe(df, filter_variable, var_name, operator, value) and returns: main_dataset,  name,  condition, main_dataset,  condition