# How to sample/fit distribution from/for bi-modal data [closed]

The context is: I have a sequence of data, of which the histograms show a bi-modal pattern. My final goal is to sample from this sequence in a simulation project. Now we want to fit a parametric model (or two models) over the data. My question is

• Is fitting parametric distribution over bi-modal data a good choice if my final goal is to sample from the data? shall I sample directly from the data? If so is there anything I shall pay special attention due to the bi-modal nature
• If I want to fit parametric models, is there any python libraries doing such? Is there any way to automatically detect whether a sample is not uni-modal?

## closed as too broad by Taylor, Michael Chernick, Jeremy Miles, Dimitris Rizopoulos, mktMay 10 at 8:58

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

One popular algorithm is the EM which is implemented, for instance, assuming that both distributions are gaussian in GaussianMixture class of scikit-learn.
After fitting a GaussianMixture you can even call the sample() method and get your samples.