class_docstr: Base class for estimators in pgmpy; `ParameterEstimator`,
  `StructureEstimator` and `StructureScore` derive from this class.
  
  Parameters
  ----------
  data: pandas DataFrame object
      object where each column represents one variable.
      (If some values in the data are missing the data cells should be set to `numpy.NaN`.
      Note that pandas converts each column containing `numpy.NaN`s to dtype `float`.)
  
  state_names: dict (optional)
      A dict indicating, for each variable, the discrete set of states (or values)
      that the variable can take. If unspecified, the observed values in the data set
      are taken to be the only possible states.
docstr: Return a list of states that the variable takes in the data.
docstr_tok: ["Return","a","list","of","states","that","the","variable","takes","in","the","data","."]
code: def _collect_state_names(self, variable):
      "Return a list of states that the variable takes in the data."
      states = sorted(
          list(self.data.loc[:, variable].dropna().unique())
      )
      return states
  
file_path: pgmpy/pgmpy/estimators/base.py
imports: from collections import OrderedDict
  import pandas
label_desc: Use image node_id 2 for calling the BaseEstimator obj's underlying member method code with example usage: obj._collect_state_names(variable) and returns: states