I try to count the unique sublist in a list, however I kept getting the error as shown below. Any idea on how to fix this?
Here’s the python code:
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
Input=IN[0]
Output = {}
for I in Input:
for II in I:
for lis in I:
Output.setdefault(tuple(lis), list()).append(1)
for a, b in Output.items():
Output[a] = sum(b)
I was following the tutorial here: https://www.geeksforgeeks.org/python-count-unique-sublists-within-list/
So in my case scenario, I expected an output that saying for L3 list, {“A”,“B”} is the most occurrence sublist, and {“A”,“C”} for the sub-sequence sublist.
Thanks in advance!