|
|
@ -127,11 +127,17 @@ print(select_fight_row(df, 'Khabib Nurmagomedov', 0))
|
|
|
|
|
|
|
|
|
|
|
|
# get all active UFC fighters (according to the limit_date parameter)
|
|
|
|
# get all active UFC fighters (according to the limit_date parameter)
|
|
|
|
def list_fighters(df, limit_date):
|
|
|
|
def list_fighters(df, limit_date):
|
|
|
|
|
|
|
|
# Filter the DataFrame to include only fights occurring after the specified limit date
|
|
|
|
df_temp = df[df['date'] > limit_date]
|
|
|
|
df_temp = df[df['date'] > limit_date]
|
|
|
|
|
|
|
|
# Create a set of all fighters from the red corner ('R_fighter') in the filtered DataFrame
|
|
|
|
set_R = set(df_temp['R_fighter'])
|
|
|
|
set_R = set(df_temp['R_fighter'])
|
|
|
|
|
|
|
|
# Create a set of all fighters from the blue corner ('B_fighter') in the filtered DataFrame
|
|
|
|
set_B = set(df_temp['B_fighter'])
|
|
|
|
set_B = set(df_temp['B_fighter'])
|
|
|
|
|
|
|
|
# Combine the sets of fighters from the red and blue corners to get all unique fighters
|
|
|
|
fighters = list(set_R.union(set_B))
|
|
|
|
fighters = list(set_R.union(set_B))
|
|
|
|
print("Number of fighter: "+str(len(fighters)))
|
|
|
|
# Print the number of unique fighters included in the list
|
|
|
|
|
|
|
|
# print("Number of fighters: " + str(len(fighters)))
|
|
|
|
|
|
|
|
# Return the list of unique fighters
|
|
|
|
return fighters
|
|
|
|
return fighters
|
|
|
|
|
|
|
|
|
|
|
|
# Last year when data fight was not full and correct
|
|
|
|
# Last year when data fight was not full and correct
|
|
|
|