Fill This Form To Receive Instant Help
Homework answers / question archive / 1) Use the PGN file on the provided link https://drive
1) Use the PGN file on the provided link
https://drive.google.com/file/d/14t3VI675QbsN9sbspOoU3zKF6eqacCNx/view?usp=sharing
2. Download file to your local system.
3. The provided game file will have the extension ".pgn" and can be viewed if opened in notepad.
4. Import it to your python platform (jupyter Notebook).
5. After importing the file. Perform following tasks:
1. Filtering the Game Data
Remove all the metadata from the file, and extract a list containing each game as a clean string. And write the game string in a file named “game_string.txt”, make sure you follow the sample file’s format ONLY.
Sample file : https://drive.google.com/file/d/10nOpNoJkdpFz5BDDp-N0297OKSK2djpW/view?usp=sharing
2. Sub files
Using the game strings from the first part, separate the moves of the white player into its file, and the black players into its file. These files should have the following name convention: "1w" and "1b", Game 1 white, and Game 1 Black, respectively.
3. Dataframe counts
Make a data frame that collects the counts of the first moves per game and returns a tuple that contains two data frames: one for white moves, and one for black moves
4. Plotting
Plot the ten most common first moves. Plot the black moves and white moves in the same graphic and explain your understanding from the graph.
Notes: