May-10-2019, 11:55 AM
(This post was last modified: May-10-2019, 11:55 AM by parthi1705.)
Have tried some thing like below but it did not return my result
Had my data in pandas and tried, but no luck
Had my data in pandas and tried, but no luck
>>> df SalesamountQuota CalendarYear Employeekey 0 28000.0 2010 272 1 308000.0 2011 272 2 582000.0 2012 272 3 387000.0 2013 272 4 367000.0 2010 281 5 3037000.0 2011 281 6 4822000.0 2012 281 7 2936000.0 2013 281 8 637000.0 2010 282 9 3440000.0 2011 282 10 478000.0 2010 296 11 12090000.0 2012 296 df_emp =df[['CalendarYear','Employeekey']] emp=df['Employeekey'].unique() empnew=pd.DataFrame(data=emp.flatten()) empnew.columns =['Employeekey'] for i in empnew: pd.merge(df_emp,df,left_on='Employeekey', right_on='CalendarYear',how='right')