We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c8b5755 commit 82bf462Copy full SHA for 82bf462
docs/tutorials/getting_started/tournament_results.rst
@@ -251,11 +251,13 @@ It is also possible to write this data directly to a csv file using the
251
`write_summary` method::
252
253
>>> results.write_summary('summary.csv')
254
+ >>> import csv
255
>>> with open('summary.csv', 'r') as outfile:
- ... 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')
+ ... csvreader = csv.reader(outfile)
+ ... for row in csvreader:
+ ... print(row)
+ ['Rank', 'Name', 'Median_score', 'Cooperation_rating', 'Wins']
+ ['0', 'Defector', '2.6...', '0.0', '3.0']
+ ['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