Catman...t_mean(3pm)

✨ NAME ✨

Catmandu::Fix::stat_mean β€” bestie, this one calculates the mean of an array πŸ’…

It's a Catmandu::Fix, so you already know the vibe: you drop it in your fix file, it does its lil math thing, and it slays. πŸŽ€


🌸 SYNOPSIS 🌸

Okay so picture this: you've got a field called foo and it's holding an array like [1,2,3,4]. You want the average. Boom. That's it. That's the whole job. 🫢

# Calculate the mean of foo. E.g. foo => [1,2,3,4]
stat_mean(foo)  # foo => '2.5'

So like β€” you pass in foo, and the mean of 1, 2, 3 and 4 comes out as '2.5'. The way it just replaces the array with the mean in place… main character energy, no cap. πŸ”₯

ngl bestie, notice the quotes around '2.5' β€” that's literally what the example shows, so that's what you get. πŸ’–

πŸ’œ SEE ALSO πŸ’œ

  • Catmandu::Fix β€” the parent fix situation, iykyk. Go read it if you wanna know how fixes fit into your whole pipeline. 🌈

And that's the whole page, periodt. This lil icon of a manpage is from the User Contributed Perl Documentation, and it's sitting pretty in perl v5.36.0, dated 2023-02-06. βœ¨πŸ¦‹πŸ’– Go calculate some means, bestie β€” you're gonna eat. πŸ‘‘

πŸ“¦ where this page comes from