<jupyter_start><jupyter_text>Need to modify the CSV file<jupyter_code>import pandas as pd

gamelogs = pd.read_csv('Gamelogs19-20.csv')

gamelogs.rename(columns={'Rk ATL':'Team'}, inplace=True)

gamelogs
gamelogs2 = pd.read_csv('Gamelogs19-20.csv')

gamelogs2.rename(columns={'Opp':'Team'}, inplace=True)

gamelogs2
# make a column with the index values
gamelogs2.reset_index(inplace=True)

# merge the two dataframes based on the selected columns.
combined = gamelogs.merge(gamelogs2, on=['Date', 'Team'])

combined
combined = combined.iloc[:,0:40]

combined.rename(columns={'DRtg_y':'OppDefRtg'}, inplace=True)

combined
combined = combined.drop(['Unnamed: 3_x', 'DRtg_x' ,'index', 'Rk ATL', 'Unnamed: 3_y', 'W/L_y', 'Tm_y', 'Opp.1_y'], axis=1)
combined
combined = combined.drop(['G_y', 'ORtg_y' ,'Pace_y', 'AST_x', 'STL_x', 'BLK_x'], axis=1)

combined
print(combined)
combined = combined.drop(['FT_x', 'FTA_x' ,'FT%_x'], axis=1)

combined
print(combined)
combined.to_csv("combined.csv")<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup