07国际象棋对局MultDiGraph多路图可视化
顺便记录一下获取WCC.csv文件
-
获取数据
点击官网链接下载文件“chess_masters_WCC.pgn.bz2”。
-
处理得到.csv文件
import bz2
import chess.pgn
import pandas as pd
# Step 1: 解压缩`.bz2`文件
input_file = 'chess_masters_WCC.pgn.bz2'
output_file = 'chess_masters_WCC.pgn'
with bz2.open(input_file, 'rb') as f_in:
with open(output_file, 'wb') as f_out:
f_out.write(f_in.<