class_docstr: Pandas dataframe class with a simplified selection function
docstr: Select rows based on a value, a sequence of values or a discriminating function
  
  Parameters
  ----------
  kwargs: str, list or callable
      selects values in the column provided as keyword, based on str matching, or
      presence in the list, or callable returning non-False on the values
  
  Example
  -------
  df.select(column1=["a", "b"])
  will return a new Selector with rows having either "a" or "b" as value in column1
docstr_tok: ["Select","rows","based","on","a","value",",","a","sequence","of","values","or","a","discriminating","function","Parameters","--","--","--","--","--","kwargs",":","str",",","list","or","callable","selects","values","in","the","column","provided","as","keyword",",","based","on","str","matching",",","or","presence","in","the","list",",","or","callable","returning","non-False","on","the","values","Example","--","--","--","-","df.select","(","column1=","[","``","a","''",",","``","b","''","]",")","will","return","a","new","Selector","with","rows","having","either","``","a","''","or","``","b","''","as","value","in","column1"]
code: def select(
      self,
      **kwargs: tp.Union[
          str, tp.Sequence[str], tp.Callable[[tp.Any], bool]
      ],
  ) -> "Selector":
      """Select rows based on a value, a sequence of values or a discriminating function
  
      Parameters
      ----------
      kwargs: str, list or callable
          selects values in the column provided as keyword, based on str matching, or
          presence in the list, or callable returning non-False on the values
  
      Example
      -------
      df.select(column1=["a", "b"])
      will return a new Selector with rows having either "a" or "b" as value in column1
      """
      df = self
      for name, criterion in kwargs.items():
          if isinstance(criterion, abc.Iterable) and not isinstance(
              criterion, str
          ):
              selected = df.loc[:, name].isin(criterion)
          elif callable(criterion):
              selected = [bool(criterion(x)) for x in df.loc[:, name]]
          else:
              selected = df.loc[:, name].isin([criterion])
          df = df.loc[selected, :]
      return Selector(df)
  
file_path: nevergrad/nevergrad/benchmark/utils.py
imports: from collections import abc
  import numpy
  import pandas
  import nevergrad.common.typing
  from nevergrad.common import testing
label_desc: Use image node_id 3 for calling the Selector obj's underlying member method code with example usage: obj.select() and returns: Selector