B
Brad Tilley
In Python, I can do this to arrays:
added = [x for x in new_data if x not in old_data]
removed = [x for x in old_data if x not in new_data]
same = [x for x in new_data if x in old_data]
I believe this is known as list comprehension in Python. How is this done in
Ruby?
Thanks,
Brad
added = [x for x in new_data if x not in old_data]
removed = [x for x in old_data if x not in new_data]
same = [x for x in new_data if x in old_data]
I believe this is known as list comprehension in Python. How is this done in
Ruby?
Thanks,
Brad