best-of-python
more-itertools
Our great sponsors
best-of-python | more-itertools | |
---|---|---|
5 | 9 | |
3,400 | 3,423 | |
2.2% | 1.6% | |
7.8 | 9.1 | |
5 days ago | 10 days ago | |
Python | Python | |
Creative Commons Attribution Share Alike 4.0 | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
best-of-python
-
Which not so well known Python packages do you like to use on a regular basis and why?
You may be interested in this best-of-python list on github.
-
I am a proficient Python coder whose learning has plateaued. Any really useful libraries I should look into learning? Taking recommendations.
I suggest looking at this and this github links which group many of the most used/useful python libraries by their category of use.
- ml-tooling/best-of-python A ranked list of awesome Python open-source libraries & tools. Updated weekly.
- Best of Python
-
[P] best-of-ml-python: A ranked list of awesome machine learning Python libraries
best-of-python: General overview of Python libraries & tools
more-itertools
-
I want to learn reading other people code
I'd bet that reading through more-itertools would be a good exercise.
-
Why iter() & next()
check out the code examples in itertools and the source code of more-itertools if you want to see cases where next and iter get used by themselves.
-
Quick way to split and zip a list?
from itertools import islice # Copied from the more-itertools library (MIT license) # https://github.com/more-itertools/more-itertools def batched(iterable, n): "Batch data into lists of length n. The last batch may be shorter." # batched('ABCDEFG', 3) --> ABC DEF G if n < 1: raise ValueError('n must be at least one') it = iter(iterable) while (batch := list(islice(it, n))): yield batch
- more-itertools: More routines for operating on iterables, beyond itertools
-
How do I loop this?
more_itertools.chunked
-
Is there a better way to write this code?
I've had a tab open to more-itertools on github for weeks; maybe I should go read it...
-
Help loading data in batches
The popular more-itertools library implements (among many others) a chunked method which yields lists of size n from an iterator. There is also the ichunked method which yields iterators of size n instead of lists.
-
How to find missing number in groups(lists)
There's a function called consecutive_groups in the more-itertools library that will do this for you efficiently.
-
I am a proficient Python coder whose learning has plateaued. Any really useful libraries I should look into learning? Taking recommendations.
Here are some that might answer your question: - algorithms is a library which contains many of the most useful algorithms for sorting, searching, working with trees, math algorithms like factorials, prime finders and many more - data classes to save you the trouble of writing everytime special methods in a class like init, repr, set, get - box allows the use of dot on dictionaries to access the keys - more-itertools for more routines to operate on iterables than those itertools provide.
What are some alternatives?
pymunk - Pymunk is a easy-to-use pythonic 2d physics library that can be used whenever you need 2d rigid body physics from Python
TheAlgorithms - All Algorithms implemented in Python
Box - Python dictionaries with advanced dot notation access
python-patterns - A collection of design patterns/idioms in Python
fastapi-featureflags - FastAPI Feature Flags
sortedcontainers - Python Sorted Container Types: Sorted List, Sorted Dict, and Sorted Set
glom - ☄️ Python's nested data operator (and CLI), for all your declarative restructuring needs. Got data? Glom it! ☄️
algorithms
gTTS - Python library and CLI tool to interface with Google Translate's text-to-speech API
PyPattyrn - A simple library for implementing common design patterns.
chepy - Chepy is a python lib/cli equivalent of the awesome CyberChef tool.
python-ds - No non-sense and no BS repo for how data structure code should be in Python - simple and elegant.