R Elbow Method Python