I have a list of lists, each list within the list contains 5 items, how do I change the values of the items in the list? I have tried the following:
for [ite
Here is an example I used recently, it was a real mind bender but hopefully it can help out some one!
pivot_peaks is a list of pandas data frames some of them are duplicates.
# Create a new list with only a single entry for each item
new_list = []
for obj_index, obj in enumerate(pivot_peaks):
add_new_frame = False
if len(new_list) == 0:
new_list.append(obj)
else:
for item in new_list:
if item.equals(obj):
add_new_frame = False
break
else:
add_new_frame = True
if add_new_frame == True:
new_list.append(obj)