- [Instructor] One of the most frequent tasks that you have to deal with in converting data is taking transactional data, where each row of data represents like one data point essentially, and aggregating it, so you can actually perform calculations and visualize the data in summary form. So a great example of this is I had this data in front of you, which is Congressional voting data, and so this was many thousands of rows of data. I can't remember how many, but essentially, each row of data represents a bill that was being voted on.
That's what this number is here, this bill_id. The vote, Yay or Nay, yes or no. For each individual person, this person here, what party they belong to and what state they're from. So literally, this is one person's vote on one bill during this session of Congress. Like I said, thousands of and thousands of rows. And I wanted to do a visualization looking at partisanship. So what I needed to do is perform a calculation to figure out, okay, so for each bill, did each person vote the same as his or her party, and do that for each and every bill that they voted on.
And so I literally wrote a script that just went through, looked at every single row of data, figured out for each person which way do they vote, yes or no, and was it the same as the majority of their peers, essentially a sum of votes for all of the Rs or Ds and do they match it or not match it. And I used a script to essentially convert that into one row per person. So I can see that this person voted with their party 504 times, voted against their party 29 times, so therefore, I can tell sort of their percentage of partisanship, as compared to some other people in the database.
Just literally by creating a script that did a sum, like literally how many times did they vote the same as their party, row by row by row. So I turned that, essentially, many thousands of rows of data into essentially five hundred and something rows of data, one for every Congress person, just by sort of aggregating all those numbers all together. This isn't the only way you can do this type of activity. I was working in SQL, in this case MySQL, so I was writing SQL script, but in the next example I'm going to show you, there's a way to do this within Excel, using something called a pivot table.
- Describe the process by which individuals’ interests are incorporated into data visualizations.
- Differentiate the use of the Ws in data visualization.
- Explain techniques involved in defining your narrative when visualizing data.
- Identify the factors that make data visualizations relatable to an audience’s interests and needs.
- Review the appropriate use of charts in data visualizations.
- Define the process involved in applying interactivity to data visualizations.