From the course: Scripting for Testers

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Solution: Create column chart

Solution: Create column chart - Python Tutorial

From the course: Scripting for Testers

Start my 1-month free trial

Solution: Create column chart

(whooshing) (soft music) - [Instructor] Hopefully, you've been able to solve the challenge on your own, but if you ran stuck or you just want to compare your solution to mine, we'll go through the way that I approach this. We'll start here by reading in the data using the CS view reader. This is very similar to what we did before. We'll create a file reader and we'll use csv.reader to read in the CSV file that we've opened. Now, we can loop over that for row in our file reader and append each row to our data list, append, row. Now that we have the chart data read in, we'll need to do a bit of clean up on it. Let's move down to here and clean up each row of the data list. We will create some variables. The first one, let's call it number of asserts and that will equal the row one, but we'll wrap that in an int so that it gets converted from a string to an int. Then, we will do the same thing for the number of failed asserts. Once again, int and this will be row two, and then we will…

Contents