Returns a pandas DataFrame where each row is a representation of the
        Team class. Rows are indexed by the team abbreviation.
961662
def dataframes(self):
        
        frames = []
        for team in self.__iter__():
            frames.append(team.dataframe)
        return pd.concat(frames)
715929
def dataframe(self):
        
        if self._away_points is None and self._home_points is None:
            return None
        fields_to_include = {
            'away_first_downs': self.away_first_downs,
            'away_fumbles': self.away_fumbles,
            'away_fumbles_lost': self.away_fumbles_lost,
            'away_interceptions': self.away_interceptions,
            'away_pass_attempts': self.away_pass_attempts,
            'away_pass_completions': self.away_pass_completions,
            'away_pass_touchdowns': self.away_pass_touchdowns,
            'away_pass_yards': self.away_pass_yards,
            'away_penalties': self.away_penalties,
            'away_points': self.away_points,
            'away_rush_attempts': self.away_rush_attempts,
            'away_rush_touchdowns': self.away_rush_touchdowns,
            'away_rush_yards': self.away_rush_yards,
            'away_total_yards': self.away_total_yards,
            'away_turnovers': self.away_turnovers,
            'away_yards_from_penalties': self.away_yards_from_penalties,
            'date': self.date,
            'home_first_downs': self.home_first_downs,
            'home_fumbles': self.home_fumbles,
            'home_fumbles_lost': self.home_fumbles_lost,
            'home_interceptions': self.home_interceptions,
            'home_pass_attempts': self.home_pass_attempts,
            'home_pass_completions': self.home_pass_completions,
            'home_pass_touchdowns': self.home_pass_touchdowns,
            'home_pass_yards': self.home_pass_yards,
            'home_penalties': self.home_penalties,
            'home_points': self.home_points,
            'home_rush_attempts': self.home_rush_attempts,
            'home_rush_touchdowns': self.home_rush_touchdowns,
            'home_rush_yards': self.home_rush_yards,
            'home_total_yards': self.home_total_yards,
            'home_turnovers': self.home_turnovers,
            'home_yards_from_penalties': self.home_yards_from_penalties,
            'losing_abbr': self.losing_abbr,
            'losing_name': self.losing_name,
            'stadium': self.stadium,
            'time': self.time,
            'winner': self.winner,
            'winning_abbr': self.winning_abbr,
            'winning_name': self.winning_name
        }
        return pd.DataFrame([fields_to_include], index=[self._uri])
81260
def index_row(a:Union[Collection,pd.DataFrame,pd.Series], idxs:Collection[int])->Any:
    ""
    if a is None: return a
    if isinstance(a,(pd.DataFrame,pd.Series)):
        res = a.iloc[idxs]
        if isinstance(res,(pd.DataFrame,pd.Series)): return res.copy()
        return res
    return a[idxs]
692720
def current(self):
        
        rankings_dict = {}

        for team in self.current_extended:
            rankings_dict[team['abbreviation']] = team['rank']
        return rankings_dict
1316826
def _vertex_list_to_dataframe(ls, id_column_name):
    
    assert HAS_PANDAS, 'Cannot use dataframe because Pandas is not available or version is too low.'
    cols = reduce(set.union, (set(v.attr.keys()) for v in ls))
    df = pd.DataFrame({id_column_name: [v.vid for v in ls]})
    for c in cols:
        df[c] = [v.attr.get(c) for v in ls]
    return df
497790
def to_df(self) -> pd.DataFrame:
        """"""
        df = pd.DataFrame(index=RangeIndex(0, self.shape[0], name=None))
        for key in self.keys():
            value = self[key]
            for icolumn, column in enumerate(value.T):
                df['{}{}'.format(key, icolumn+1)] = column
        return df
1084556
def asRow(self):
        
        fields = self.fields
        row = [""] * len(fields)
        for k,v in self._attributes.items():
            row[fields.index(k)] = v
            del v
            del k
        if self.geometry is not None:
            row.append(self.geometry)
            fields.append("SHAPE@")
        return row, fields
1371436
def dataframe(self):
        
        temp_index = self._index
        rows = []
        indices = []
        if not self._season:
            return None
        for season in self._season:
            self._index = self._season.index(season)
            rows.append(self._dataframe_fields())
            indices.append(season)
        self._index = temp_index
        return pd.DataFrame(rows, index=[indices])
574716
def _shape(self, df):
        

        row, col = df.shape
        return row + df.columns.nlevels, col + df.index.nlevels
196118
def get_frame(self):
        
        metric_items = list(self.db.metrics.find({'run_name': self.model_config.run_name}).sort('epoch_idx'))
        if len(metric_items) == 0:
            return pd.DataFrame(columns=['run_name'])
        else:
            return pd.DataFrame(metric_items).drop(['_id', 'model_name'], axis=1).set_index('epoch_idx')
644914
def team_districts(self, team):
        
        return [District(raw) for raw in self._get('team/%s/districts' % self.team_key(team))]
451488
def dataframe(self):
        
        fields_to_include = {
            'abbreviation': self.abbreviation,
            'assist_percentage': self.assist_percentage,
            'assists': self.assists,
            'away_losses': self.away_losses,
            'away_wins': self.away_wins,
            'block_percentage': self.block_percentage,
            'blocks': self.blocks,
            'conference': self.conference,
            'conference_losses': self.conference_losses,
            'conference_wins': self.conference_wins,
            'defensive_rebounds': self.defensive_rebounds,
            'effective_field_goal_percentage':
            self.effective_field_goal_percentage,
            'field_goal_attempts': self.field_goal_attempts,
            'field_goal_percentage': self.field_goal_percentage,
            'field_goals': self.field_goals,
            'free_throw_attempt_rate': self.free_throw_attempt_rate,
            'free_throw_attempts': self.free_throw_attempts,
            'free_throw_percentage': self.free_throw_percentage,
            'free_throws': self.free_throws,
            'free_throws_per_field_goal_attempt':
            self.free_throws_per_field_goal_attempt,
            'games_played': self.games_played,
            'home_losses': self.home_losses,
            'home_wins': self.home_wins,
            'losses': self.losses,
            'minutes_played': self.minutes_played,
            'name': self.name,
            'net_rating': self.net_rating,
            'offensive_rating': self.offensive_rating,
            'offensive_rebound_percentage': self.offensive_rebound_percentage,
            'offensive_rebounds': self.offensive_rebounds,
            'opp_assist_percentage': self.opp_assist_percentage,
            'opp_assists': self.opp_assists,
            'opp_block_percentage': self.opp_block_percentage,
            'opp_blocks': self.opp_blocks,
            'opp_defensive_rebounds': self.opp_defensive_rebounds,
            'opp_effective_field_goal_percentage':
            self.opp_effective_field_goal_percentage,
            'opp_field_goal_attempts': self.opp_field_goal_attempts,
            'opp_field_goal_percentage': self.opp_field_goal_percentage,
            'opp_field_goals': self.opp_field_goals,
            'opp_free_throw_attempt_rate': self.opp_free_throw_attempt_rate,
            'opp_free_throw_attempts': self.opp_free_throw_attempts,
            'opp_free_throw_percentage': self.opp_free_throw_percentage,
            'opp_free_throws': self.opp_free_throws,
            'opp_free_throws_per_field_goal_attempt':
            self.opp_free_throws_per_field_goal_attempt,
            'opp_offensive_rating': self.opp_offensive_rating,
            'opp_offensive_rebound_percentage':
            self.opp_offensive_rebound_percentage,
            'opp_offensive_rebounds': self.opp_offensive_rebounds,
            'opp_personal_fouls': self.opp_personal_fouls,
            'opp_points': self.opp_points,
            'opp_steal_percentage': self.opp_steal_percentage,
            'opp_steals': self.opp_steals,
            'opp_three_point_attempt_rate': self.opp_three_point_attempt_rate,
            'opp_three_point_field_goal_attempts':
            self.opp_three_point_field_goal_attempts,
            'opp_three_point_field_goal_percentage':
            self.opp_three_point_field_goal_percentage,
            'opp_three_point_field_goals': self.opp_three_point_field_goals,
            'opp_two_point_field_goal_attempts':
            self.opp_two_point_field_goal_attempts,
            'opp_two_point_field_goal_percentage':
            self.opp_two_point_field_goal_percentage,
            'opp_two_point_field_goals': self.opp_two_point_field_goals,
            'opp_total_rebound_percentage': self.opp_total_rebound_percentage,
            'opp_total_rebounds': self.opp_total_rebounds,
            'opp_true_shooting_percentage': self.opp_true_shooting_percentage,
            'opp_turnover_percentage': self.opp_turnover_percentage,
            'opp_turnovers': self.opp_turnovers,
            'pace': self.pace,
            'personal_fouls': self.personal_fouls,
            'points': self.points,
            'simple_rating_system': self.simple_rating_system,
            'steal_percentage': self.steal_percentage,
            'steals': self.steals,
            'strength_of_schedule': self.strength_of_schedule,
            'three_point_attempt_rate': self.three_point_attempt_rate,
            'three_point_field_goal_attempts':
            self.three_point_field_goal_attempts,
            'three_point_field_goal_percentage':
            self.three_point_field_goal_percentage,
            'three_point_field_goals': self.three_point_field_goals,
            'two_point_field_goal_attempts':
            self.two_point_field_goal_attempts,
            'two_point_field_goal_percentage':
            self.two_point_field_goal_percentage,
            'two_point_field_goals': self.two_point_field_goals,
            'total_rebound_percentage': self.total_rebound_percentage,
            'total_rebounds': self.total_rebounds,
            'true_shooting_percentage': self.true_shooting_percentage,
            'turnover_percentage': self.turnover_percentage,
            'turnovers': self.turnovers,
            'win_percentage': self.win_percentage,
            'wins': self.wins
        }
        return pd.DataFrame([fields_to_include], index=[self._abbreviation])
616290
def get_rows(self):
        
        possible_dataframes = ['F', 'FY', 'M', 'S',
                               'D_cba', 'D_pba',  'D_imp', 'D_exp',
                               'D_cba_reg', 'D_pba_reg',
                               'D_imp_reg', 'D_exp_reg',
                               'D_cba_cap', 'D_pba_cap',
                               'D_imp_cap', 'D_exp_cap', ]
        for df in possible_dataframes:
            if (df in self.__dict__) and (getattr(self, df) is not None):
                return getattr(self, df).index.get_values()
        else:
            logging.warn("No attributes available to get row names")
            return None
187671
def row(self, fields):
        """"""

        d = self.dict

        row = [None] * len(fields)

        for i, f in enumerate(fields):
            if f in d:
                row[i] = d[f]

        return row
222957
def dataframe(self):
        
        if self._points_allowed is None and self._points_scored is None:
            return None
        fields_to_include = {
            'boxscore_index': self.boxscore_index,
            'date': self.date,
            'datetime': self.datetime,
            'game': self.game,
            'location': self.location,
            'losses': self.losses,
            'opponent_abbr': self.opponent_abbr,
            'opponent_name': self.opponent_name,
            'points_allowed': self.points_allowed,
            'points_scored': self.points_scored,
            'result': self.result,
            'streak': self.streak,
            'time': self.time,
            'wins': self.wins
        }
        return pd.DataFrame([fields_to_include], index=[self._boxscore])
332323
def get_dataframe_row(self, dataset_cases, predicted_data, pdb_data, record_id, additional_prediction_data_columns):
        ''''''
        record = dataset_cases[record_id]
        for m in record['PDBMutations']:
            assert('DSSPSimpleSSType' not in m)
            m['DSSPSimpleSSType'] = dssp_elision.get(m['ComplexDSSP']) or dssp_elision.get(m['MonomericDSSP'])
            m['DSSPType'] = m.get('ComplexDSSP') or m.get('MonomericDSSP')
            m['DSSPExposure'] = m.get('ComplexExposure') or m.get('MonomericExposure')

        dataframe_record = super(DBBenchmarkRun, self).get_dataframe_row(dataset_cases, predicted_data, pdb_data, record_id, additional_prediction_data_columns)
        # add columns
        return dataframe_record
475631
def get_dataframe(self, sort_key="wall_time", **kwargs):
        
        import pandas as pd
        frame = pd.DataFrame(columns=AbinitTimerSection.FIELDS)

        for osect in self.order_sections(sort_key):
            frame = frame.append(osect.to_dict(), ignore_index=True)

        # Monkey patch
        frame.info =  self.info
        frame.cpu_time =  self.cpu_time
        frame.wall_time =  self.wall_time
        frame.mpi_nprocs =  self.mpi_nprocs
        frame.omp_nthreads =  self.omp_nthreads
        frame.mpi_rank =  self.mpi_rank
        frame.fname =  self.fname

        return frame