[USER (data scientist)]: Great! We have a new competitor named 'Raonic M.'. I need to find the win rates, head-to-head records against other players in the affected matches, and performance on the same surface as the tournament for this new competitor. Please provide a dataframe with Player Names, Win Rates, Head-to-Head Records, and Surface Performance.

[YOU (AI assistant)]: To find the win rates, head-to-head records, and surface performance for 'Raonic M.', you can use the following code:
'''
import pandas as pd
import numpy as np
import pickle
from decision_company import read_csv_file, logical_and, logical_or, create_dataframe, concatenate_objects, search_where, extract_unique_values, update_dict, assert_series


atp_tennis = read_csv_file('atp_tennis.csv')

# Find Federer matches
federer_matches = atp_tennis[logical_or(assert_series(atp_tennis['Player_1'], 'Federer R.', 'equality'), assert_series(atp_tennis['Player_2'], 'Federer R.', 'equality'))]

# Get Federer opponents
federer_opponents = extract_unique_values(search_where(federer_matches['Player_1'], assert_series(federer_matches['Player_1'], 'Federer R.', 'inequality'), federer_matches['Player_2']))

# Retrieve unique surface types
surface_types = extract_unique_values(atp_tennis['Surface'])

# Function to calculate a tennis player's overall win rate, head-to-head record, and performance on different surfaces against a specific opponent.
def calculate_performance(player, opponent, data, surface_types):
    player_matches = data[logical_or(logical_and(assert_series(data['Player_1'], player, 'equality'), assert_series(data['Player_2'], opponent, 'equality')), logical_and(assert_series(data['Player_1'], opponent, 'equality'), assert_series(data['Player_2'], player, 'equality')))]
    total_matches = len(player_matches)
    wins = len(player_matches[assert_series(player_matches['Winner'], player, 'equality')])
    win_rate = wins / total_matches if total_matches > 0 else 0

    h2h_record = wins / total_matches if total_matches > 0 else 0

    surface_performance = {}
    for surface in surface_types:
        player_surface_matches = player_matches[assert_series(player_matches['Surface'], surface, 'equality')]
        player_surface_wins = len(player_surface_matches[assert_series(player_surface_matches['Winner'], player, 'equality')])
        surface_performance[surface] = player_surface_wins / player_surface_matches.shape[0] if player_surface_matches.shape[0] > 0 else 0

    return win_rate, h2h_record, surface_performance

# Initialize an empty dataframe for storing the results
columns = ['Player', 'Opponent', 'Win Rate', 'Head-to-Head'] + [f'{surface} Surface Performance' for surface in surface_types]
player_stats = create_dataframe()

# Loop through Federer's opponents
for opponent in federer_opponents:
    # Calculate win rate, head-to-head record, and surface performance for Raonic M. against each opponent
    win_rate, h2h_record, surface_performance = calculate_performance('Raonic M.', opponent, atp_tennis, surface_types)

    # Append the results to the dataframe
    row_data = {'Player': 'Raonic M.', 'Opponent': opponent, 'Win Rate': win_rate, 'Head-to-Head': h2h_record}
    update_dict(row_data, {f'{surface} Surface Performance': surface_performance[surface] for surface in surface_types})
    player_stats = concatenate_objects(player_stats, create_dataframe())

print(player_stats)
pickle.dump(player_stats,open("./ref_result/player_stats.pkl","wb"))
'''

[USER (data scientist)]: Sorry, I executed your codes, it reports: create_dataframe() missing 1 required positional argument: 'data', fix it.
My template of code snippet is:

---BEGIN CODE TEMPLATE---

import pandas as pd
import numpy as np
import pickle
from decision_company import read_csv_file,

# please import the necessary private functions from decision_company first

# Load the dataset
atp_tennis = read_csv_file("atp_tennis.csv")

# YOUR SOLUTION BEGIN:
<code1>
[COMPLETE YOUR CODE] 
</code1>
# YOUR SOLUTION END

print(player_stats)

# save data
pickle.dump(player_stats,open("./pred_result/player_stats.pkl","wb"))

---END CODE TEMPLATE---

[YOU (AI assistant)]: Here is the revised code:
'''
import pandas as pd
import numpy as np
import pickle
from decision_company import read_csv_file,

# please import the necessary private functions from decision_company first

# Load the dataset
atp_tennis = read_csv_file("atp_tennis.csv")

# YOUR SOLUTION BEGIN:
