Add/remove items from one-to-many column

Hi Kirk,

Apologies for making you conduct all these experiments yourself, we should improve this behaviour and document it in the meantime.

Anyway, you worked it out - “Multiple Rows” columns are not real Python lists, so don’t fully support the standard list operations (hopefully they will soon). Right now all you can reliably do is get and set the values. In particular, this will work:

m['my_column'] += [new_item]

As will this (to remove an element):

m['my_column'] = [r for r in m['my_column'] if r != row_to_remove]

Hope that helps!

5 Likes