tidy_phoenix = tidy(
phoenix,
mutate({
'month': (d) => new Date(d.date).toLocaleString('default', { month: 'long' }),
'actual_mean_temp': (d) => Number(d.actual_mean_temp)
}),
groupBy('month', [
summarize({ mean_temp: mean('actual_mean_temp'), month_date: first('date') })
]),
mutate({
'month_date': (d) => new Date(d.month_date),
'city': "Phoenix"
}),
select(['-month'])
)