[USER (data scientist)]: That's a nice function! Now, let's create a dataframe to store the results and loop through Federer's opponents to calculate the performance of Raonic M. Please generate and display a DataFrame containing win rate, head-to-head records, and surface performance of 'Raonic M.' against each of his opponents in the ATP tennis dataset.
My template of code snippet is:

---BEGIN CODE TEMPLATE---

import pandas as pd
import numpy as np
import pickle

atp_tennis = pd.read_csv('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)]: Sure, let's initialize an empty dataframe with the required columns and loop through Federer's opponents to calculate the performance: 
'''
import pandas as pd
import numpy as np
import pickle

atp_tennis = pd.read_csv('atp_tennis.csv')

# YOUR SOLUTION BEGIN:
