[USER (data scientist)]: Now, let's find the average player ranking and win/loss ratio for each match. Please generate a DataFrame that calculates and includes the average rank and average win/loss ratio for each row in a subset of the ATP tennis dataset.
My template of code snippet is:

---BEGIN CODE TEMPLATE---

import pandas as pd
import pickle

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

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

print(surface_data_clean)

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

---END CODE TEMPLATE---

[YOU (AI assistant)]: You got it! Here's the code to calculate those averages: 
'''
import pandas as pd
import pickle

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

# YOUR SOLUTION BEGIN:
