0

I have one table with ID and age. Let this be table 1. Rows in table 1 are 1000. I have table 2 with 10000 rows. I need to select 1000 rows from table 2 such that the table2.age has same probability distribution as table1.age. Is there any way to do this in python? I don't know where to start. In other and more precise words, lets estimate the probability distribution that fits best with the sample of 1000 from table 1 and then construct a sample from another table which would give the the closest fit to original probability distribution estimate.

Kathan Vyas
  • 355
  • 3
  • 16
  • I think it is misspecified problem that you are solving. You will be selecting the same 1000 rows. – Evgeny Sep 10 '18 at 19:32
  • @EPo I did not get you. These are two different tables, both having Id and Age as columns. I want to select rows from table 2 that match probability distribution of that from table 1 age. – Kathan Vyas Sep 10 '18 at 19:36
  • The rows that you select from table 2 will be the same as in table 1 if you are to match the distribution exactly. – Evgeny Sep 10 '18 at 19:40
  • @EPo I don't think that is necessary. With same probability distribution, values of the column can be different. It is possible for two columns having different set of values but portraying same probability distribution. Don't you think this is true? sorry if I am not able to understand your comment. – Kathan Vyas Sep 10 '18 at 19:56
  • If you have a task "lets estimate the probability distribution that fits best with the sample of 1000 from table 1 and then construct a sample from another table which would give the the closest fit to original probability distribution estimate", you have case, but these are by no means "same" distributions. 1000 samples is unique discrete density, if you want same discrete density, you need same 1000 samples. – Evgeny Sep 10 '18 at 20:02
  • @EPo I guess I did not use the words correctly. Let me edit it in my question as per your say. I want to do exactly what you said in the first half of your comment. – Kathan Vyas Sep 10 '18 at 20:09

0 Answers0