returns the dataframe representation of the symbol's final data
558170
def datatable_df(self):
        
        data = self._all_datatable_data()
        adf = pd.DataFrame(data)
        adf.columns = self.dt_all_cols
        return self._finish_df(adf, 'ALL')
344887
def get_dataframe():
        
        names = []
        [names.extend(line.split()) for line in CONTROL_VARIABLE_LINES]

        defaults = []
        [defaults.extend(line.split()) for line in CONTROL_DEFAULT_LINES]

        types, required,cast_defaults,formats = [],[],[],[]
        for name,default in zip(names,defaults):
            if '[' in name or ']' in name:
                required.append(False)
            else:
                required.append(True)
            v,t,f = ControlData._parse_value(default)
            types.append(t)
            formats.append(f)
            cast_defaults.append(v)
        return pandas.DataFrame({"name":names,"type":types,
                                     "value":cast_defaults,"required":required,
                                    "format":formats})
921979
def dataframe(self):
        
        fields_to_include = {
            'abbreviation': self.abbreviation,
            'conference': self.conference,
            'conference_losses': self.conference_losses,
            'conference_win_percentage': self.conference_win_percentage,
            'conference_wins': self.conference_wins,
            'first_downs': self.first_downs,
            'first_downs_from_penalties': self.first_downs_from_penalties,
            'fumbles_lost': self.fumbles_lost,
            'games': self.games,
            'interceptions': self.interceptions,
            'losses': self.losses,
            'name': self.name,
            'pass_attempts': self.pass_attempts,
            'pass_completion_percentage': self.pass_completion_percentage,
            'pass_completions': self.pass_completions,
            'pass_first_downs': self.pass_first_downs,
            'pass_touchdowns': self.pass_touchdowns,
            'pass_yards': self.pass_yards,
            'penalties': self.penalties,
            'plays': self.plays,
            'points_against_per_game': self.points_against_per_game,
            'points_per_game': self.points_per_game,
            'rush_attempts': self.rush_attempts,
            'rush_first_downs': self.rush_first_downs,
            'rush_touchdowns': self.rush_touchdowns,
            'rush_yards': self.rush_yards,
            'rush_yards_per_attempt': self.rush_yards_per_attempt,
            'simple_rating_system': self.simple_rating_system,
            'strength_of_schedule': self.strength_of_schedule,
            'turnovers': self.turnovers,
            'win_percentage': self.win_percentage,
            'wins': self.wins,
            'yards': self.yards,
            'yards_from_penalties': self.yards_from_penalties,
            'yards_per_play': self.yards_per_play
        }
        return pd.DataFrame([fields_to_include], index=[self._abbreviation])
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
95424
def cols_(self) -> pd.DataFrame:
        
        try:
            s = self.df.iloc[0]
            df = pd.DataFrame(s)
            df = df.rename(columns={0: "value"})

            def run(row):
                t = row[0]
                return type(t).__name__

            s = df.apply(run, axis=1)
            df = df.rename(columns={0: "value"})
            df["types"] = s
            return df
        except Exception as e:
            self.err(e)
38772
def toDF(self, *cols):
        
        jdf = self._jdf.toDF(self._jseq(cols))
        return DataFrame(jdf, self.sql_ctx)
1236290
def getAll(self, symbol):
        
        values = self.__request(symbol, 'l1c1va2xj1b4j4dyekjm3m4rr5p5p6s7').split(',')
        data = {}
        data['price'] = values[0]
        data['change'] = values[1]
        data['volume'] = values[2]
        data['avg_daily_volume'] = values[3]
        data['stock_exchange'] = values[4]
        data['market_cap'] = values[5]
        data['book_value'] = values[6]
        data['ebitda'] = values[7]
        data['dividend_per_share'] = values[8]
        data['dividend_yield'] = values[9]
        data['earnings_per_share'] = values[10]
        data['52_week_high'] = values[11]
        data['52_week_low'] = values[12]
        data['50day_moving_avg'] = values[13]
        data['200day_moving_avg'] = values[14]
        data['price_earnings_ratio'] = values[15]
        data['price_earnings_growth_ratio'] = values[16]
        data['price_sales_ratio'] = values[17]
        data['price_book_ratio'] = values[18]
        data['short_ratio'] = values[19]
        return data
990913
function getDataFromDotNotation (d, row) {
  return d.split('.').reduce((o, i) => { if (o === undefined) { return undefined } else { return o[i] } }, row)
}
628312
def to_string(self, buf=None, format_abs_ref_as='string',
                  upper_triangle=True, header=True, index=True, **kwargs):
        
        out = self._sympy_formatter()
        out = out._abs_ref_formatter(format_as=format_abs_ref_as)
        if not upper_triangle:
            out = out._remove_upper_triangle()

        content = out._frame.to_string(buf=buf, header=header, index=index,
                                       **kwargs)
        if not index and not header:
            # NOTE(the following might be removed in the future
            # introduced because of formatting bug in pandas
            # See https://github.com/pandas-dev/pandas/issues/13032)
            space = ' ' * (out.loc[:, 'atom'].str.len().max()
                           - len(out.iloc[0, 0]))
            content = space + content
        return content
1038644
def _fetch_dataframe(self):
        
        def reshape(training_summary):
            # Helper method to reshape a single training job summary into a dataframe record
            out = {}
            for k, v in training_summary['TunedHyperParameters'].items():
                # Something (bokeh?) gets confused with ints so convert to float
                try:
                    v = float(v)
                except (TypeError, ValueError):
                    pass
                out[k] = v
            out['TrainingJobName'] = training_summary['TrainingJobName']
            out['TrainingJobStatus'] = training_summary['TrainingJobStatus']
            out['FinalObjectiveValue'] = training_summary.get('FinalHyperParameterTuningJobObjectiveMetric',
                                                              {}).get('Value')

            start_time = training_summary.get('TrainingStartTime', None)
            end_time = training_summary.get('TrainingEndTime', None)
            out['TrainingStartTime'] = start_time
            out['TrainingEndTime'] = end_time
            if start_time and end_time:
                out['TrainingElapsedTimeSeconds'] = (end_time - start_time).total_seconds()
            return out
        # Run that helper over all the summaries.
        df = pd.DataFrame([reshape(tjs) for tjs in self.training_job_summaries()])
        return df
877961
def dataframe(self):
        
        fields_to_include = {
            'assists': self.assists,
            'at_bats': self.at_bats,
            'average_leverage_index': self.average_leverage_index,
            'average_leverage_index_pitcher':
            self.average_leverage_index_pitcher,
            'bases_on_balls': self.bases_on_balls,
            'bases_on_balls_given': self.bases_on_balls_given,
            'base_out_runs_added': self.base_out_runs_added,
            'base_out_runs_saved': self.base_out_runs_saved,
            'batters_faced': self.batters_faced,
            'batting_average': self.batting_average,
            'earned_runs_allowed': self.earned_runs_allowed,
            'earned_runs_against': self.earned_runs_against,
            'fly_balls': self.fly_balls,
            'game_score': self.game_score,
            'grounded_balls': self.grounded_balls,
            'hits': self.hits,
            'hits_allowed': self.hits_allowed,
            'home_runs_thrown': self.home_runs_thrown,
            'inherited_runners': self.inherited_runners,
            'inherited_score': self.inherited_score,
            'innings_pitched': self.innings_pitched,
            'line_drives': self.line_drives,
            'name': self.name,
            'on_base_percentage': self.on_base_percentage,
            'on_base_plus_slugging_percentage':
            self.on_base_plus_slugging_percentage,
            'pitches_thrown': self.pitches_thrown,
            'plate_appearances': self.plate_appearances,
            'putouts': self.putouts,
            'runs': self.runs,
            'runs_allowed': self.runs_allowed,
            'runs_batted_in': self.runs_batted_in,
            'slugging_percentage': self.slugging_percentage,
            'strikes': self.strikes,
            'strikes_contact': self.strikes_contact,
            'strikes_looking': self.strikes_looking,
            'strikes_swinging': self.strikes_swinging,
            'strikes_thrown': self.strikes_thrown,
            'strikeouts': self.strikeouts,
            'times_struck_out': self.times_struck_out,
            'unknown_bat_types': self.unknown_bat_types,
            'win_probability_added': self.win_probability_added,
            'win_probability_added_pitcher':
            self.win_probability_added_pitcher,
            'win_probability_for_offensive_player':
            self.win_probability_for_offensive_player,
            'win_probability_subtracted': self.win_probability_subtracted
        }
        return pd.DataFrame([fields_to_include], index=[self._player_id])
1284752
def _FormatDataToken(self, token_data):
    
    format_string = bsmtoken.BSM_TOKEN_DATA_PRINT.get(
        token_data.data_format, 'UNKNOWN')

    if token_data.data_format == 4:
      data = bytes(bytearray(token_data.data)).split(b'\x00')[0]
      data = data.decode('utf-8')
    else:
      data = ''.join(['{0:02x}'.format(byte) for byte in token_data.data])
    return {
        'format': format_string,
        'data': data}
562668
def help_dataframe(self):
        
        help =  '%sMaking a DataFrame: %s how to make a dataframe from raw data (pcap, memory, pe files)' % (color.Yellow, color.Green)
        help += '\n\t%sNote: for memory_image and pe_files see > help dataframe_memory or dataframe_pe'  % (color.Green)
        help += '\n\n%sPCAP Example:'  % (color.Green)
        help += '\n\t%s> load_sample /path/to/pcap/gold_xxx.pcap [\'bad\', \'threatglass\']' % (color.LightBlue)
        help += '\n\t%s> view     # view is your friend use it often' % (color.LightBlue)
        help += '\n\n%sGrab the http_log from the pcap (also play around with other logs):'  % (color.Green)
        help += '\n\t%s> http_log_md5 = view()[\'view\'][\'bro_logs\'][\'http_log\']' % (color.LightBlue)
        help += '\n\t%s> http_log_md5 (returns the md5 of the http_log)' % (color.LightBlue)
        help += '\n\n%sStream back the ^contents^ of the http_log:'  % (color.Green)
        help += '\n\t%s> http_log = stream_sample(http_log_md5)' % (color.LightBlue)     
        help += '\n\n%sPut the http_log into a dataframe:'  % (color.Green)
        help += '\n\t%s> http_df = pd.DataFrame(http_log)' % (color.LightBlue)
        help += '\n\t%s> http_df.head()' % (color.LightBlue)
        help += '\n\t%s> http_df.groupby([\'host\',\'id.resp_h\',\'resp_mime_types\'])[[\'response_body_len\']].sum()' % (color.LightBlue)
        help += '\n\t%s> http_df.describe() %s' % (color.LightBlue, color.Normal)
        return help
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])
1057596
def dataframe(self):
        
        fields_to_include = {
            'abbreviation': self.abbreviation,
            'at_bats': self.at_bats,
            'average_batter_age': self.average_batter_age,
            'average_pitcher_age': self.average_pitcher_age,
            'away_losses': self.away_losses,
            'away_record': self.away_record,
            'away_wins': self.away_wins,
            'balks': self.balks,
            'bases_on_balls': self.bases_on_balls,
            'bases_on_walks_given': self.bases_on_walks_given,
            'bases_on_walks_given_per_nine_innings':
            self.bases_on_walks_given_per_nine_innings,
            'batters_faced': self.batters_faced,
            'batting_average': self.batting_average,
            'complete_game_shutouts': self.complete_game_shutouts,
            'complete_games': self.complete_games,
            'doubles': self.doubles,
            'earned_runs_against': self.earned_runs_against,
            'earned_runs_against_plus': self.earned_runs_against_plus,
            'extra_inning_losses': self.extra_inning_losses,
            'extra_inning_record': self.extra_inning_record,
            'extra_inning_wins': self.extra_inning_wins,
            'fielding_independent_pitching':
            self.fielding_independent_pitching,
            'games': self.games,
            'games_finished': self.games_finished,
            'grounded_into_double_plays': self.grounded_into_double_plays,
            'hit_pitcher': self.hit_pitcher,
            'hits': self.hits,
            'hits_allowed': self.hits_allowed,
            'hits_per_nine_innings': self.hits_per_nine_innings,
            'home_losses': self.home_losses,
            'home_record': self.home_record,
            'home_runs': self.home_runs,
            'home_runs_against': self.home_runs_against,
            'home_runs_per_nine_innings': self.home_runs_per_nine_innings,
            'home_wins': self.home_wins,
            'innings_pitched': self.innings_pitched,
            'intentional_bases_on_balls': self.intentional_bases_on_balls,
            'interleague_record': self.interleague_record,
            'last_ten_games_record': self.last_ten_games_record,
            'last_thirty_games_record': self.last_thirty_games_record,
            'last_twenty_games_record': self.last_twenty_games_record,
            'league': self.league,
            'losses': self.losses,
            'losses_last_ten_games': self.losses_last_ten_games,
            'losses_last_thirty_games': self.losses_last_thirty_games,
            'losses_last_twenty_games': self.losses_last_twenty_games,
            'losses_vs_left_handed_pitchers':
            self.losses_vs_left_handed_pitchers,
            'losses_vs_right_handed_pitchers':
            self.losses_vs_right_handed_pitchers,
            'losses_vs_teams_over_500': self.losses_vs_teams_over_500,
            'losses_vs_teams_under_500': self.losses_vs_teams_under_500,
            'luck': self.luck,
            'name': self.name,
            'number_of_pitchers': self.number_of_pitchers,
            'number_players_used': self.number_players_used,
            'on_base_percentage': self.on_base_percentage,
            'on_base_plus_slugging_percentage':
            self.on_base_plus_slugging_percentage,
            'on_base_plus_slugging_percentage_plus':
            self.on_base_plus_slugging_percentage_plus,
            'opposing_runners_left_on_base':
            self.opposing_runners_left_on_base,
            'plate_appearances': self.plate_appearances,
            'pythagorean_win_loss': self.pythagorean_win_loss,
            'rank': self.rank,
            'record_vs_left_handed_pitchers':
            self.record_vs_left_handed_pitchers,
            'record_vs_right_handed_pitchers':
            self.record_vs_right_handed_pitchers,
            'record_vs_teams_over_500': self.record_vs_teams_over_500,
            'record_vs_teams_under_500': self.record_vs_teams_under_500,
            'run_difference': self.run_difference,
            'runners_left_on_base': self.runners_left_on_base,
            'runs': self.runs,
            'runs_against': self.runs_against,
            'runs_allowed_per_game': self.runs_allowed_per_game,
            'runs_batted_in': self.runs_batted_in,
            'sacrifice_flies': self.sacrifice_flies,
            'sacrifice_hits': self.sacrifice_hits,
            'saves': self.saves,
            'shutouts': self.shutouts,
            'simple_rating_system': self.simple_rating_system,
            'single_run_losses': self.single_run_losses,
            'single_run_record': self.single_run_record,
            'single_run_wins': self.single_run_wins,
            'slugging_percentage': self.slugging_percentage,
            'stolen_bases': self.stolen_bases,
            'streak': self.streak,
            'strength_of_schedule': self.strength_of_schedule,
            'strikeouts': self.strikeouts,
            'strikeouts_per_base_on_balls': self.strikeouts_per_base_on_balls,
            'strikeouts_per_nine_innings': self.strikeouts_per_nine_innings,
            'times_caught_stealing': self.times_caught_stealing,
            'times_hit_by_pitch': self.times_hit_by_pitch,
            'times_struck_out': self.times_struck_out,
            'total_bases': self.total_bases,
            'total_runs': self.total_runs,
            'triples': self.triples,
            'whip': self.whip,
            'wild_pitches': self.wild_pitches,
            'win_percentage': self.win_percentage,
            'wins': self.wins,
            'wins_last_ten_games': self.wins_last_ten_games,
            'wins_last_thirty_games': self.wins_last_thirty_games,
            'wins_last_twenty_games': self.wins_last_twenty_games,
            'wins_vs_left_handed_pitchers': self.wins_vs_left_handed_pitchers,
            'wins_vs_right_handed_pitchers':
            self.wins_vs_right_handed_pitchers,
            'wins_vs_teams_over_500': self.wins_vs_teams_over_500,
            'wins_vs_teams_under_500': self.wins_vs_teams_under_500
        }
        return pd.DataFrame([fields_to_include], index=[self._abbreviation])
1938
def _symbols():
    
    global _SYMBOLS
    if _SYMBOLS is None:
        tmp = [(s, 'symbol') for s in _data()['symbol'].keys()]
        tmp += [(s, 'alpha3') for s in _data()['alpha3'].keys()]
        tmp += [(s.name, 'name') for s in _data()['alpha3'].values()]
        _SYMBOLS = sorted(
            tmp,
            key=lambda s: (len(s[0]), ord(s[0][0])),
            reverse=True)

    return _SYMBOLS
26367
def _get_chart_info(df, vtype, cat, prep, callers):
    
    maxval_raw = max(list(df["value.floor"]))
    curdf = df[(df["variant.type"] == vtype) & (df["category"] == cat)
               & (df["bamprep"] == prep)]
    vals = []
    labels = []
    for c in callers:
        row = curdf[df["caller"] == c]
        if len(row) > 0:
            vals.append(list(row["value.floor"])[0])
            labels.append(list(row["value"])[0])
        else:
            vals.append(1)
            labels.append("")
    return vals, labels, maxval_raw