I'm trying to fake data for the coffee shop. I've two features age and menu. Menu includes various type of drinks such as coffee [latte, espresso, mocca, etc], tea [milktea, lemontea], milk [freshmilk, matchamilk, etc]. What I'm trying to do is to fake menu based on the age like if the age is higher than 15, 80% of people who has the age higher than 15 will mostly order coffee randomly from the list of coffee [latte, espresso, mocca, etc], 20% will order milk and tea. Any idea on how to do this in the python?

  • $\begingroup$ How do you want behavior to change as age changes? $\endgroup$ Oct 4, 2018 at 13:13
  • $\begingroup$ In general you could use a parameterized Dirichlet distribution to generate categorical distributions, where you shift the $\alpha$ vector depending on age. $\endgroup$ Oct 4, 2018 at 13:35

1 Answer 1


There are many Python packages to generate synthetic data. One example is Faker.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.