Created
July 15, 2009 06:05
-
-
Save besquared/147499 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
# | |
# This is probably a decent interview assignment | |
# | |
# Pivot Function | |
# | |
# The pivot function takes the unique values of a table column and turns them into | |
# columns of a new table, with the values of the new cells being chosen from a column | |
# in the original table | |
# | |
# Example: | |
# | |
# hour | source | revenue | |
# 1 | A | 100 | |
# 1 | B | 200 | |
# 2 | A | 200 | |
# | |
# Becomes | |
# | |
# hour | A | B | |
# 1 | 100 | 200 | |
# 2 | 200 | nil |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment