Sep-29-2019, 08:47 PM
Hello,
Not sure where I'm going wrong at. Any help would be appreciated.
I have a csv file that has win/loss/draw data. Quick brief of the csv file:
3 comma separated columns. Columns are "Side", "Result" and "Year" with data below.
I'm trying to get the data from the csv file to pandas in python and to count the number of times "Win" appears but I'm getting a Key Error: 'Win' when I run the below script. Confirmed "Win" is in the csv file.
Not sure where I'm going wrong at. Any help would be appreciated.
I have a csv file that has win/loss/draw data. Quick brief of the csv file:
3 comma separated columns. Columns are "Side", "Result" and "Year" with data below.
I'm trying to get the data from the csv file to pandas in python and to count the number of times "Win" appears but I'm getting a Key Error: 'Win' when I run the below script. Confirmed "Win" is in the csv file.
from pandas import DataFrame, read_csv import matplotlib.pyplot as plt import pandas as pd df = pd.read_csv('test.csv') df[df["Result"]==1].count()["Win"] print(df)