class_docstr: Class storing numerical data for an experiment.
  
  The dataframe is retrieved via the `df` property. The data can be stored
  to an external store for future use by attaching it to an experiment using
  `experiment.attach_data()` (this requires a description to be set.)
  
  
  Attributes:
      df: DataFrame with underlying data, and required columns. For BaseData, the
          required columns are "arm_name", "metric_name", "mean", and "sem", the
          latter two of which must be numeric.
      description: Human-readable description of data.
class_docstr_tok: ["Class","storing","numerical","data","for","an","experiment",".","The","dataframe","is","retrieved","via","the","`","df","`","property",".","The","data","can","be","stored","to","an","external","store","for","future","use","by","attaching","it","to","an","experiment","using","`","experiment.attach_data","(",")","`","(","this","requires","a","description","to","be","set",".",")","Attributes",":","df",":","DataFrame","with","underlying","data",",","and","required","columns",".","For","BaseData",",","the","required","columns","are","``","arm_name","''",",","``","metric_name","''",",","``","mean","''",",","and","``","sem","''",",","the","latter","two","of","which","must","be","numeric",".","description",":","Human-readable","description","of","data","."]
docstr: Construct a new object with the subset of rows corresponding to the
  provided trial indices AND metric names. If either trial_indices or
  metric_names are not provided, that dimension will not be filtered.
docstr_tok: ["Construct","a","new","object","with","the","subset","of","rows","corresponding","to","the","provided","trial","indices","AND","metric","names",".","If","either","trial_indices","or","metric_names","are","not","provided",",","that","dimension","will","not","be","filtered","."]
code: def filter(
      self,
      trial_indices: Optional[Iterable[int]] = None,
      metric_names: Optional[Iterable[str]] = None,
  ) -> Data:
      """Construct a new object with the subset of rows corresponding to the
      provided trial indices AND metric names. If either trial_indices or
      metric_names are not provided, that dimension will not be filtered.
      """
  
      return self.__class__(
          df=self._filter_df(
              df=self.df,
              trial_indices=trial_indices,
              metric_names=metric_names,
          )
      )
  
imports: from __future__ import annotations
  import json
  from abc import abstractmethod
  from functools import reduce
  from hashlib import md5
  from typing import Any, Dict, Iterable, List, Optional, Set, Type, TypeVar, Union
  import numpy
  import pandas
  from ax.core.types import TFidelityTrialEvaluation, TTrialEvaluation
  from ax.utils.common.base import Base
  from ax.utils.common.serialization import extract_init_args, SerializationMixin, serialize_init_args, TClassDecoderRegistry, TDecoderRegistry
  from ax.utils.common.typeutils import checked_cast, not_none
label_desc: Use image node_id 4 for calling the Data obj's underlying member method code with example usage: obj.filter(trial_indices, metric_names) and returns: self