Created
May 26, 2010 20:31
-
-
Save ashaw/415003 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#State,attribute | |
#California,sunshine | |
#California,beaches | |
#Texas,oil | |
#Texas,rock_festivals | |
s = TableFu.new(csv) | |
s.faceted_by("State").each do |state| | |
puts state.row | |
end | |
#or even better | |
s.faceted_by("State").each do |state| | |
puts state.row['attribute'] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yeah it's always gunna be a bit clunky for the one common column. but you can now do row[key] for all rows. and then you can accomplish this with:
Of course rather than all these hoops, you can also just grab the original table and loop through the rows[key]