Created
November 15, 2017 04:22
-
-
Save djfan/1276e0a8d7a167e24f663dcc011b8bf9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
add_input = './Desktop/DCM_output.xlsx' | |
sheet_name = 'Sheet1' | |
add_output2 = './Desktop/spendcleanoutput.xlsx' | |
df=pd.read_excel(add_input, sheetname=sheet_name) | |
df = df.dropna(how='all') | |
df.loc[df.Channel=='Display-TrueView',['Cost','Views','Clicks','Video played to 25%','Video played to 50%','Video played to 75%','Video played to 100%']] = 0 | |
df.loc[(df['Partner Type'].isin(['Programmatic', 'Programmatic Video'])) & (df.Channel=='Display'), 'Cost']=0 | |
df.to_excel(add_output2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment