Mean Yearly Temperatures Across Clusters
The last chart we got was even harder to interpret than two chapters ago. But if we are talking about 'peeks', the number 4 best fits it.
Let's compare the yearly average temperatures across 4 predicted clusters.
Swipe to start coding
Calculate the yearly average temperatures across each cluster. The structure of data is shown below.

Follow the next steps:
- Create a
KMedoidsmodel with 4 clusters namedmodel. - Fit the 3-15 (these are positions, not indices) columns of
datatomodel. - Add the
'prediction'column todatawith predicted bymodellabels. - Group the
dataDataFrame by thepredictioncolumn, then apply the.mean()function twice: the first call will calculate the monthly means, the second one (withaxis = 1) will calculate the yearly averages.
Lösung
Danke für Ihr Feedback!
single
Fragen Sie AI
Fragen Sie AI
Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen
Awesome!
Completion rate improved to 3.57
Mean Yearly Temperatures Across Clusters
Swipe um das Menü anzuzeigen
The last chart we got was even harder to interpret than two chapters ago. But if we are talking about 'peeks', the number 4 best fits it.
Let's compare the yearly average temperatures across 4 predicted clusters.
Swipe to start coding
Calculate the yearly average temperatures across each cluster. The structure of data is shown below.

Follow the next steps:
- Create a
KMedoidsmodel with 4 clusters namedmodel. - Fit the 3-15 (these are positions, not indices) columns of
datatomodel. - Add the
'prediction'column todatawith predicted bymodellabels. - Group the
dataDataFrame by thepredictioncolumn, then apply the.mean()function twice: the first call will calculate the monthly means, the second one (withaxis = 1) will calculate the yearly averages.
Lösung
Danke für Ihr Feedback!
single