Fix pivot example in cookbook
Merge branch 'issue-379-pivot-fix'
Closes #379