this is the code that I have. As you can see I append every element to the list if the element is not already in the list but I noticed I still somehow get duplicate elements.
def getExtraData(table):
extraData = list()
for ele in table:
extras = re.findall('\[(.+?)\]', str(ele[0]))
for extra in extras:
single = extra.split(", ")
for s in single:
if s not in extraData:
extraData.append(s)
return extraData
Took a screenshot in pycharm debugger console to show that the element is really the same.
Why could this happen and how can I fix it?