docs: def as_dataframe(self, max_rows=None):
        """Creates a pandas dataframe from the query metadata.
  
        Args:
          max_rows: The maximum number of timeseries metadata to return. If None,
              return all.
  
        Returns:
          A pandas dataframe containing the resource type, resource labels and
          metric labels. Each row in this dataframe corresponds to the metadata
          from one time series.
        """
        max_rows = len(self._timeseries_list) if max_rows is None else max_rows
        headers = [{
            'resource': ts.resource._asdict(), 'metric': ts.metric._asdict()}
            for ts in self._timeseries_list[:max_rows]]
  
        if not headers:
          return pandas.DataFrame()
  
        dataframe = pandas.io.json.json_normalize(headers)
  
        # Add a 2 level column header.
        dataframe.columns = pandas.MultiIndex.from_tuples(
            [(col, '') if col == 'resource.type' else col.rsplit('.', 1)
             for col in dataframe.columns])
  
        # Re-order the columns.
        resource_keys = google.cloud.monitoring._dataframe._sorted_resource_labels(
            dataframe['resource.labels'].columns)
        sorted_columns = [('resource.type', '')]
        sorted_columns += [('resource.labels', key) for key in resource_keys]
        sorted_columns += sorted(col for col in dataframe.columns
                                 if col[0] == 'metric.labels')
        dataframe = dataframe[sorted_columns]
  
        # Sort the data, and clean up index values, and NaNs.
        dataframe = dataframe.sort_values(sorted_columns)
        dataframe = dataframe.reset_index(drop=True).fillna('')
        return dataframe