-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.md
36 lines (26 loc) · 916 Bytes
/
README.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# INST414
import pandas as pd
pga_stats = pd.read_csv('new_pga.csv')
pga_stats
# Putting table. Sorts putting values from high
putting = pga_stats[['NAME', 'EARNINGS', 'PUTTS']].copy()
x = putting.drop(putting[putting['PUTTS'] == 0.000].index)
x
y = x.sort_values('PUTTS', ascending=False)
y
putting_tail = y.tail(20)
putting_tail
putting_head = y.head(20)
putting_head
print(putting_head['PUTTS'].sum())
print(putting_head['PUTTS'].mean())
print(putting_tail['PUTTS'].sum())
print(putting_tail['PUTTS'].mean())
putting_tail['EARNINGS'].sum()
putting_head['EARNINGS'].sum()
putting_tail['EARNINGS'].sum() - putting_head['EARNINGS'].sum()
pga_stats['Earnings per event'] = pga_stats['EARNINGS'] / pga_stats['EVNTS']
pga_stats['Earnings per event'] = pga_stats['Earnings per event'].round(2)
pga_stats.head(20)
pga_stats.sort_values(by='Earnings per event', ascending=False, inplace=True)
pga_stats.head(20)