THis will create a empty dictionary with keys from unique elements in result and initialise all default values to 0.
_dict = dict.fromkeys(set([e["name"] for e in result]), 0)
output: {'b': 0, 'a': 0}
This will count the number of element in result for the keys present in _dict.
[_dict.update({element["name"]: _dict[element["name"]]+1}) for element in result]
Since your "number" is same for whole list,
[{"name": key, "number": 1, "count": _dict[key]} for key in _dict.keys()]
output:[{'name': 'b', 'number': 1, 'count': 1},
{'name': 'a', 'number': 1, 'count': 2}]
if number is not same for all the keys,
remove all the duplicate dicts from the result list.
no_dups = [i for n, i in enumerate(result) if i not in result[n + 1:]]
output: [{'name': 'b', 'number': 1}, {'name': 'a', 'number': 1}]
create another dict with values as their number :
new = {}
[new.update({i["name"]: i["number"]}) for i in b]
Repeat the last step, like this
[{"name": key, "number": new[key], "count": _dict[key]} for key in _dict.keys()]
name, numberare variables with the right types.