Oct-14-2020, 07:19 PM
Something like
import pandas as pd
import numpy as np
df = pd.DataFrame(data = {'Code':[100,100,100,200,200],
'Value':[np.nan,1000,2000,np.nan,2000],
'ValueCount':[np.nan,1,2,np.nan,1],
'Expected_Cum_Value':[1000,1000,1000,2000,2000],})
df['Result_Value'] = np.where(df['ValueCount'] == 1, df['Value'],'')
df
Can't wait for formatting to return....
J
import pandas as pd
import numpy as np
df = pd.DataFrame(data = {'Code':[100,100,100,200,200],
'Value':[np.nan,1000,2000,np.nan,2000],
'ValueCount':[np.nan,1,2,np.nan,1],
'Expected_Cum_Value':[1000,1000,1000,2000,2000],})
df['Result_Value'] = np.where(df['ValueCount'] == 1, df['Value'],'')
df
Can't wait for formatting to return....
J