In [1]:
import pandas as pd
In [2]:
season = 2019
urls = [
'http://www.acb.com/estadisticas-individuales/{}/temporada_id/{}/tipo_id/0'.format(x, season)
for x in
[
'valoracion',
'puntos',
'rebotes',
'asistencias',
'robos', 'tapones',
'mas-menos',
'minutos',
'tiros3',
'tiros3-porciento',
'tiros2',
'tiros2-porciento',
'tiros1',
'tiros1-porciento',
'rebotes-defensivos',
'rebotes-ofensivos',
'faltas-recibidas',
'faltas-cometidas',
'mates'
]
]
In [3]:
data = pd.concat([pd.read_html(url)[0].iloc[:, 1:] for url in urls], axis=0).drop_duplicates()
In [4]:
data.columns = [
'name', 'games', 'minutes', 'points',
'3p_converted', '3p_attempted', '3p_percentage',
'2p_converted', '2p_attempted', '2p_percentage',
'1p_converted', '1p_attempted', '1p_percentage',
'offensive_rebounds', 'deffensive_rebounds', 'rebounds',
'assists', 'steals', 'turnovers',
'blocks', 'received_blocks',
'dunks', 'faults', 'received_faults',
'plus_minus', 'pir'
]
data = data.set_index('name')
In [5]:
data.describe()
Out[5]:
In [6]:
data[['pir', 'plus_minus']].sum(axis=1).sort_values(ascending=False).head(18)
Out[6]:
In [7]:
(
data[
['points',
'offensive_rebounds',
'assists',
'received_faults',
'3p_converted',
'2p_converted',
'1p_converted',
'plus_minus']
].sum(axis=1) -
data[
['3p_attempted',
'2p_attempted',
'1p_attempted',
'turnovers',
'received_blocks'
]
].sum(axis=1)
).sort_values(ascending=False).head(18)
Out[7]:
In [8]:
(
data[
['deffensive_rebounds',
'steals',
'blocks',
'plus_minus']
].sum(axis=1) - data['faults']
).sort_values(ascending=False).head(18)
Out[8]:
In [9]:
(data['plus_minus'] + data['minutes'] / 2 - data['pir']).sort_values(ascending=False).head(18)
Out[9]:
In [10]:
((data['assists'] + 1) / (data['turnovers'] + 1)).sort_values(ascending=False).head(18)
Out[10]:
In [11]:
(
data['dunks'] + data['blocks'] - data['received_blocks'] + data['2p_converted'] - data['2p_attempted']
).sort_values(ascending=False).head(18)
Out[11]:
In [12]:
(
data[['3p_attempted', '2p_attempted', 'turnovers', 'received_blocks']].sum(axis=1) -
data[['assists','plus_minus']].sum(axis=1)
).sort_values(ascending=False).head(18)
Out[12]:
In [ ]:
In [ ]: