Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Weekly Challenges

Solve the challenge, share your solution and summit the ranks of our Community!

Also available in | Français | Português | Español | 日本語
IDEAS WANTED

Want to get involved? We're always looking for ideas and content for Weekly Challenges.

SUBMIT YOUR IDEA

Challenge #384: Uncover Tennis Stats Upsets!

abe_ibanez
9 - Comet
Spoiler
image.pngimage.png
gawa
16 - Nebula
16 - Nebula

A bit confused about the definition of avg rank diff.

Spoiler
image.png
Reesetrain2
9 - Comet
9 - Comet

All,

 

My solution:

Spoiler
Screenshot 2023-08-19 223158.png

AUAlka
5 - Atom
Spoiler
Snag_1142462.png
Eswaran
8 - Asteroid

Screenshot 2023-08-20 124204.png

 

Eswaran
8 - Asteroid

 

abc.jpg

 

Christina_H
14 - Magnetar

My solution attached

Spoiler
image.png
alacoume
9 - Comet

My solution:

kaiserj
8 - Asteroid

😀

PhilipMannering
16 - Nebula
16 - Nebula

Solution attached.

 

Spoiler
image.png

And in the Python Tool,

Spoiler
from ayx import Alteryx
df = Alteryx.read('#1')

cols = ['Tournament', 'Winner', 'WRank', 'LRank']
rows = df['Round'] == 'The Final'
df = df.loc[rows, cols]

df[['WRank', 'LRank']] = df[['WRank', 'LRank']].astype(int)
df['RankDiff'] = df['WRank'] - df['LRank']

dfg = df.groupby('Tournament')['RankDiff'].agg(['count', 'mean'])
tournament = dfg[dfg['count']>=20].nlargest(1, 'mean').index[0]

df = df.loc[df['Tournament']==tournament]

output = df.groupby('Winner')['Tournament'].count()\
        .nlargest(1)\
        .reset_index()\
        .rename(columns={'Tournament':'Count'})

Alteryx.write(output, 1)