From the course: Scripting for Testers
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Solution: Create column chart - Python Tutorial
From the course: Scripting for Testers
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Gathering data9m 14s
-
Using Google Chart API6m 17s
-
(Locked)
Challenge: Create column chart1m 20s
-
(Locked)
Solution: Create column chart4m 12s
-
(Locked)
Create a Google Sheets service account3m 27s
-
(Locked)
Using Google Sheets API8m 26s
-
(Locked)
Challenge: Simple test report webpage4m 38s
-
(Locked)
Solution: Simple test report webpage5m 26s
-
(Locked)
-
-
-