def load_nf_histplayerinfo(sport, identifiers_to_load):
"""
Load previously saved dataframes of numberfire prediction data.
:param str sport: which sport!
:param list[str] identifiers_to_load: id of players to load
:return dict[str, DataFrame]: dict of player -> prediction data for player
"""
loaded = 0
histplayerinfo_dict = {}
for identifier in identifiers_to_load:
target_file = get_histplayerinfo_filename(sport, identifier)
if os.path.exists(target_file):
histplayerinfo_dict[identifier] = pandas.read_pickle(target_file)
# Attempt to convert the index to time based if possible
if histplayerinfo_dict[identifier] is not None and 'date' in histplayerinfo_dict[identifier].columns:
histplayerinfo_dict[identifier].set_index('date', inplace=True)
loaded += 1
return histplayerinfo_dict
评论列表
文章目录