たとえば
import collections
d = collections.defaultdict(lambda:collections.defaultdict(float))
のようにすれば
d['poko']['hoge'] += 1.0
みたいなカウントアップがsetdefaultを書かずに書ける
Go to list of users who liked
More than 5 years have passed since last update.
たとえば
import collections
d = collections.defaultdict(lambda:collections.defaultdict(float))
のようにすれば
d['poko']['hoge'] += 1.0
みたいなカウントアップがsetdefaultを書かずに書ける
Register as a new user and use Qiita more conveniently
Go to list of users who liked