I have a Data Frame with 15 columns suppose out of which i want only 6. I am performing aggregate and then group by but it is throwing error.
def my_compute_function(my_input):
df=pd.DataFrame(my_input)
df2=df[(df['D'] == "Validated")]
df2[['A','E','F']]=df2[['A','E','F']].apply(pd.to_numeric)
df3=df2[['A','B','C','D','E','F']].groupby(['B','C','D']).agg({'A':
'max','E': 'max','F': 'max'}).reset_index()
return df3
So i want only 6 columns A,B,C,D,E,F.
When i am adding this line
df2[['A','E','F']]=df2[['A','E','F']].apply(pd.to_numeric)
it is throwing error that
ValueError: can not infer schema from empty dataset.