Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Keep getting This error File C:/Users/davis/AppData/Local/Programs/Python/Python36-32/SeniorProject.py, line 74, in home_rank = dataset[dataset[Team] == home_team][Rk].values[0] IndexError: index 0 is out of bounds for axis 0 with

Keep getting This error

 File "C:/Users/davis/AppData/Local/Programs/Python/Python36-32/SeniorProject.py", line 74, in  home_rank = dataset[dataset["Team"] == home_team]["Rk"].values[0] IndexError: index 0 is out of bounds for axis 0 with size 0 

Code

for index, row in dataset.iterrows(): home_team = row["Home Team"] visitor_team = row["Visitor Team"] row["Home Win Streak"] = win_streak[home_team] row["Visitor Win Streak"] = win_streak[visitor_team] dataset.ix[index] = row # Set current win if row["Home Team Win"]: win_streak[home_team] += 1 win_streak[visitor_team] = 0 else: win_streak[home_team] = 0 win_streak[visitor_team] += 1

dataset["Home Team Ranks Higher"] = 0 for index , row in dataset.iterrows(): home_team = row["Home Team"] visitor_team = row["Visitor Team"] home_rank = dataset[dataset["Team"] == home_team]["Rk"].values[0] visitor_rank = standing[standing["Team"] == visitor_team]["Rk"].values[0] row["Home Team Rank Higher"] = int(home_rank > visitor_rank) dataset.ix[index] = row

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Data Mining

Authors: Pang Ning Tan, Michael Steinbach, Vipin Kumar

1st Edition

ISBN: 321321367, 978-0321321367

More Books

Students also viewed these Databases questions

Question

How many multiples of 4 are there between 10 and 250?

Answered: 1 week ago

Question

How many three-digit numbers are divisible by 7?

Answered: 1 week ago