Skip to content

Commit 82bf462

Browse files
committed
Correct doctest.
1 parent c8b5755 commit 82bf462

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

docs/tutorials/getting_started/tournament_results.rst

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,13 @@ It is also possible to write this data directly to a csv file using the
251251
`write_summary` method::
252252

253253
>>> results.write_summary('summary.csv')
254+
>>> import csv
254255
>>> with open('summary.csv', 'r') as outfile:
255-
... out = outfile.read()
256-
>>> pprint.pprint(out)
257-
('Rank,Name,Median_score,Cooperation_rating,Wins\n'
258-
'0,Defector,2.6,0.0,3.0\n'
259-
'1,Tit For Tat,2.3,0.7,0.0\n'
260-
'2,Grudger,2.3,0.7,0.0\n'
261-
'3,Cooperator,2.0,1.0,0.0\n')
256+
... csvreader = csv.reader(outfile)
257+
... for row in csvreader:
258+
... print(row)
259+
['Rank', 'Name', 'Median_score', 'Cooperation_rating', 'Wins']
260+
['0', 'Defector', '2.6...', '0.0', '3.0']
261+
['1', 'Tit For Tat', '2.3...', '0.7', '0.0']
262+
['2', 'Grudger', '2.3...', '0.7', '0.0']
263+
['3', 'Cooperator', '2.0...', '1.0', '0.0']

0 commit comments

Comments
 (0)