Issue
for x in range(1, num_sims + 1):
output_lines[x]=output_lines.QB.map(NFL_sim.set_index('Player')[x].to_dict())
I'm wondering if this is the most efficient way to write this expression. This is a for loop in a bigger for loop, where all other parts of my for loop take a combined 0.1 seconds, but this one section takes 5 seconds.
Solution
You could try iloc
:
payouts.iloc[:, 1: 100] = payouts.iloc[:, 1: 100] / payouts.Lineup.map(output_lines_with_mine.set_index('Lineup')['Dupes'].to_dict())
Answered By - U12-Forward
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.