Consider this dataframe
my_input_df = pd.DataFrame({
'export_services': [[1],[],[2,4,5],[4,6]],
'import_services': [[],[4,5,6,7],[],[]],
'seaport':['china','mexico','africa','europe'],
'price_of_fish':['100','150','200','250'],
'price_of_ham':['10','10','20','20']})
And I want to do a filter on the export_services that is boolean (discards empty lists) and output only a subset of columns
my_output_df = pd.DataFrame({
'export_services': [[1],[2,4,5],[4,6]],
'seaport':['china','africa','europe'],
'price_of_fish':['100','200','250']})
How would I go about this?
Thanks :)