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