I have a datatable Frame created as:
comidas_gen_dt = dt.Frame({
'country':list('ABCDE'),
'id':[1,2,3,4,5],
'egg':[10,20,30,5,40],
'veg':[30,40,10,3,5],
'fork':[5,10,2,1,9],
'beef':[90,50,20,None,4]})
I have created a custom function to select a list of required columns from a frame DT
as,
def pydt_select_cols(DT, *rmcols):
return DT[:, *dt_cols]
So, here is the recommend syntax to remove columns from DT:
DT[:, f[:].remove([f.a, f.b, f.c])
following the above syntax of DT, I've create another custom function to keep a side a list of columns as
def pydt_remove_cols(DT, *rmcols):
dt_cols = [*rmcols]
return DT[:, f[:].remove(dt_cols)]
I'm executing the function as
pydt_remove_cols(comidas_gen_dt, 'id', 'country', 'egg')
and it's throwing the error
TypeError: Computed columns cannot be used in
.remove()
Could you please help me how to go ahead with it?