http://contrib.scikit-learn.org/imbalanced-learn/
In an ideal world, we would have perfectly balanced datasets and we would all train models and be happy. Unfortunately, the real world is not like that, and certain tasks favor very imbalanced data. For example, when predicting fraud in credit card transactions, you would expect that the vast majority of the transactions (+99.9%?) are actually legit. Training ML(machine_learning) algorithms naively will lead to dismal performance, so extra care is needed when working with these types of datasets.
Imbalanced-learn is a Python package which offers implementations of some of those techniques, to make your life much easier.