1

I have made a density distribution with the following code:

sns.distplot(df['Amount'], hist=True, kde=True,
             color = 'darkblue', 
             hist_kws={'edgecolor':'black'},
             kde_kws={'linewidth': 4})

How can I draw a random sample from this distribution?

Eureka
  • 11
  • 1
  • 1
    Thank you @Emma. I did look through that document. The problem is that it only seems to discuss how to plot the distribution, not how to draw a sample from it – Eureka Apr 04 '19 at 00:05
  • Since seaborn is a ***plot***ting library, it is probably expected that it can only ***plot*** distributions and cannot draw random samples. – ImportanceOfBeingErnest Apr 04 '19 at 00:07
  • @ImportanceOfBeingErnest Yes, you're probably right. That's what I am concerned about. I think I'll try to find an alternative method to draw samples from then. – Eureka Apr 04 '19 at 00:17
  • Maybe [this](https://stackoverflow.com/questions/21100716/fast-arbitrary-distribution-random-sampling) is a good start. – ImportanceOfBeingErnest Apr 04 '19 at 00:24

0 Answers0