def convert_traits(player_1_df, player_2_df):
    traits_list = ['Backs Into Player', 'Bicycle Kicks', 'Chip Shot', 'Dives Into Tackles', 'Early Crosser', 'Fancy Passes', 'Finesse Shot', 'Flair', 'Giant Throw-In', 'GK Cautious With Crosses', 'GK Comes For Crosses', 'GK Flat Kick', 'GK Long Thrower', 'GK Save With Foot', 'Injury Prone', 'Leadership', 'Long Passer', 'Long Shot Taker', 'Long Throw-In', 'One Club Player', 'Outside Foot Shot', 'Play Maker', 'Power Header', 'Rushes Out Of Goal', 'Second Wind', 'Set Play Specialist', 'Solid Player', 'Speed Dribbler', 'Swerve', 'Takes Powerful Driven Free Kicks', 'Team Player', 'Technical Dribbler']
    player_1_df_player_traits = player_1_df['player_traits']
    player_2_df_player_traits = player_2_df['player_traits']
    player_1_df = player_1_df.drop(columns='player_traits')
    player_2_df = player_2_df.drop(columns='player_traits')
    for trait in traits_list:
        trait_value = 0
        for p_trait in player_1_df_player_traits.values[0].split(','):
            if (trait in p_trait):
                trait_value = 1
                break
        player_1_df[trait] = trait_value
        trait_value = 0
        for p_trait in player_2_df_player_traits.values[0].split(','):
            if (trait in p_trait):
                trait_value = 1
                break
        player_2_df[trait] = trait_value
    return (player_1_df, player_2_df)
def convert_traits(player_1_df, player_2_df):
    traits_list = ['Backs Into Player', 'Bicycle Kicks', 'Chip Shot', 'Dives Into Tackles', 'Early Crosser', 'Fancy Passes', 'Finesse Shot', 'Flair', 'Giant Throw-In', 'GK Cautious With Crosses', 'GK Comes For Crosses', 'GK Flat Kick', 'GK Long Thrower', 'GK Save With Foot', 'Injury Prone', 'Leadership', 'Long Passer', 'Long Shot Taker', 'Long Throw-In', 'One Club Player', 'Outside Foot Shot', 'Play Maker', 'Power Header', 'Rushes Out Of Goal', 'Second Wind', 'Set Play Specialist', 'Solid Player', 'Speed Dribbler', 'Swerve', 'Takes Powerful Driven Free Kicks', 'Team Player', 'Technical Dribbler']
    player_1_df_player_traits = player_1_df['player_traits']
    player_2_df_player_traits = player_2_df['player_traits']
    player_1_df = player_1_df.drop(columns='player_traits')
    player_2_df = player_2_df.drop(columns='player_traits')
    for trait in traits_list:
        trait_value = 0
        for p_trait in player_1_df_player_traits.values[0].split(','):
            if (trait in p_trait):
                trait_value = 1
                break
        player_1_df[trait] = trait_value
        trait_value = 0
        for p_trait in player_2_df_player_traits.values[0].split(','):
            if (trait in p_trait):
                trait_value = 1
                break
        player_2_df[trait] = trait_value
    return (player_1_df, player_2_df)