I’m working on the defaultdict thing and I get what it is doing now that I’m breaking everything down, I just have a question on lambda (I know, not technically related to defaultdict). Is there a way to put lambda:x+1 so what I’m wanting x to be is I want that to be whatever the key is. so
trn_anno = collections.defaultdict(lambda:x+1)
would look like this:
trn_anno would give you
13 is that a thing you can do with lambda?
I’ve tried to google it, but I haven’t seen anything that does this.