コード例 #1
0
import sys
sys.path.insert(0, '../utilities')
import add_subdir_to_path


import pandas as pd
import matplotlib.pyplot as plt
import glob
from mysql_populate_table import get_pos_news_date , get_neg_news_date, getplayerscore
from dateutil import parser
import my_config

t=my_config.ConfigSectionMap("logging")['output_dir']


player_name="alvaro-morata"  ## "antoine-griezmann"#"radja-nainggolan"
player_surname="zaha"
path =r'/Users/ashish/Documents/footballindex/data/' # use your path
allFiles = glob.glob(path + "*.txt")

scores=getplayerscore(player_name)


player=scores.loc[scores.player_id==player_name, ["bprice",
                                                  "last_1min_pct_change",
                                                  "last_2min_pct_change",
                                                  "last_3min_pct_change",
                                                  "last_4min_pct_change",
                                                  "last_5min_pct_change",
                                                  "last_6min_pct_change",
                                                  "last_7min_pct_change",
コード例 #2
0
# myplot.py
from bokeh.plotting import figure, curdoc
from bokeh.driving import linear
import random
import api_parser
import my_config

from bokeh.plotting import figure, show, output_file
from bokeh.models import Legend
import datetime
from bokeh.models import DatetimeTickFormatter

BOKEH_PY_LOG_LEVEL = True

#Set the API link
api_link = my_config.ConfigSectionMap("football")['api_link']

TOOLS = "crosshair,pan,wheel_zoom,box_zoom,reset,hover,previewsave"

#p = figure(x_axis_type="datetime", plot_width=900, plot_height=700, tools=TOOLS)

#p.xaxis.axis_label = 'Date'
#p.yaxis.axis_label = 'Price'
#r= p.line([], [], color='green' , legend="legend"  ,line_width=4)


def datetime(x):
    return np.array(x, dtype=np.datetime64)


p = figure(plot_width=900, plot_height=700, x_axis_type="datetime")
コード例 #3
0
ファイル: getPlayerList.py プロジェクト: manhar/footballindex
from mysql_populate_table import insert_d_player_list
import my_config
import ssl

## Disable SSL certificate check
try:
    _create_unverified_https_context = ssl._create_unverified_context
except AttributeError:
    # Legacy Python that doesn't verify HTTPS certificates by default
    pass
else:
    # Handle target environment that doesn't support HTTPS verification
    ssl._create_default_https_context = _create_unverified_https_context

#Set Logging directories
output_dir = my_config.ConfigSectionMap("logging")['output_dir']

#Set the API link
api_link = my_config.ConfigSectionMap("football")['api_link']


def coalesce(dic, lkp_key, default_value):
    if lkp_key in dic:
        return str((dic[lkp_key]))
    else:
        return default_value


#function to get data in a pipe delimited format
def get_data(datetime_id, df, txn_date, txn_time, data_file):