Last active
September 24, 2024 22:40
-
-
Save quanon/d83fae1514c9f6849f4c9206e97314b0 to your computer and use it in GitHub Desktop.
Count yo-yos by brand
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Count the yo-yos I have by brand and get the top 5 brands. | |
# Use the CSV output from Notion's database to tally. | |
require 'csv' | |
rows = CSV.read(Pathname(Dir.home).join('Downloads/my_yoyos.csv')) | |
resutls = rows.slice(1..).map { _1[1].split(/,\s*/) }.flatten.tally | |
resutls.sort_by { -_2 }.first(5).to_h |
Author
quanon
commented
Sep 24, 2024

Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment