Add a `reduce` method
{'login': 'zhangir-azerbayev', 'id': 59542043, 'node_id': 'MDQ6VXNlcjU5NTQyMDQz', 'avatar_url': 'https://avatars.githubusercontent.com/u/59542043?v=4', 'gravatar_id': '', 'url': 'https://api.github.com/users/zhangir-azerbayev', 'html_url': 'https://github.com/zhangir-azerbayev', 'followers_url': 'https://api.github.com/users/zhangir-azerbayev/followers', 'following_url': 'https://api.github.com/users/zhangir-azerbayev/following{/other_user}', 'gists_url': 'https://api.github.com/users/zhangir-azerbayev/gists{/gist_id}', 'starred_url': 'https://api.github.com/users/zhangir-azerbayev/starred{/owner}{/repo}', 'subscriptions_url': 'https://api.github.com/users/zhangir-azerbayev/subscriptions', 'organizations_url': 'https://api.github.com/users/zhangir-azerbayev/orgs', 'repos_url': 'https://api.github.com/users/zhangir-azerbayev/repos', 'events_url': 'https://api.github.com/users/zhangir-azerbayev/events{/privacy}', 'received_events_url': 'https://api.github.com/users/zhangir-azerbayev/received_events', 'type': 'User', 'site_admin': False}
[{'id': 1935892871, 'node_id': 'MDU6TGFiZWwxOTM1ODkyODcx', 'url': 'https://api.github.com/repos/huggingface/datasets/labels/enhancement', 'name': 'enhancement', 'color': 'a2eeef', 'default': True, 'description': 'New feature or request'}]
[]
Hi! Sure, feel free to open a PR, so we can see the API you have in mind. I would like to give it a go! #self-assign
### Feature request

Right now the `Dataset` class implements `map()` and `filter()`, but leaves out the third functional idiom popular among Python users: `reduce`. 

### Motivation

A `reduce` method is often useful when calculating dataset statistics, for example, the occurrence of a particular n-gram or the average line length of a code dataset.  

### Your contribution

I haven't contributed to `datasets` before, but I don't expect this will be too difficult, since the implementation will closely follow that of `map` and `filter`. I could have a crack over the weekend. 
{'url': 'https://api.github.com/repos/huggingface/datasets/issues/5496/reactions', 'total_count': 0, '+1': 0, '-1': 0, 'laugh': 0, 'hooray': 0, 'confused': 0, 'heart': 0, 'rocket': 0, 'eyes': 0}