import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.cluster import KMeans
# 读取网页中的数据表
table = []
for i in range(1,7):
table.append(pd.read_html('https://nba.hupu.com/stats/players/pts/%d' %i)[0])
# 所有数据纵向合并为数据框
players = pd.concat(table)
players.head()