
#########################################################
###7#####compute KDE ##
####################################################
X = gym.head_posx.values
Y = gym.head_posy.values
Z = gym.head_posz.values

xmin = X.min()
xmax = X.max()
ymin = Y.min()
ymax = Y.max()
zmin = Z.min()
zmax = Z.max()




values = np.vstack([X, Y, Z])

density = stats.gaussian_kde(values)(values)
Zdensity = (density - density.min())/(density.max()-density.min())*100
#gym["density"]=density
#gym["zdensity"]=Zdensity



idx = Zdensity.argsort()
X, Y, Z, Zdensity = X[idx], Y[idx], Z[idx], Zdensity[idx]
6a686b49f38f801a17dca61f33fa5f24d72f37c0
<mask token>

X = gym.head_posx.values
Y = gym.head_posy.values
Z = gym.head_posz.values
xmin = X.min()
xmax = X.max()
ymin = Y.min()
ymax = Y.max()
zmin = Z.min()
zmax = Z.max()
values = np.vstack([X, Y, Z])
density = stats.gaussian_kde(values)(values)
Zdensity = (density - density.min()) / (density.max() - density.min()) * 100
idx = Zdensity.argsort()
X, Y, Z, Zdensity = X[idx], Y[idx], Z[idx], Zdensity[idx]


#########################################################
###7#####compute KDE ##
####################################################
X = gym.head_posx.values
Y = gym.head_posy.values
Z = gym.head_posz.values

xmin = X.min()
xmax = X.max()
ymin = Y.min()
ymax = Y.max()
zmin = Z.min()
zmax = Z.max()




values = np.vstack([X, Y, Z])

density = stats.gaussian_kde(values)(values)
Zdensity = (density - density.min())/(density.max()-density.min())*100
#gym["density"]=density
#gym["zdensity"]=Zdensity



idx = Zdensity.argsort()
X, Y, Z, Zdensity = X[idx], Y[idx], Z[idx], Zdensity[idx]