I have 2 dataframes and I want to get df, where in first file I have a lot of data and in the second file I have a list of iD, that I want get from first file.
I use
merged = pd.merge(buys, chunk, left_on='id', right_on='ID')
where chunk - a part of first(big) file. And buys - file with list of id. In output file I have ID, that not in buys.
What I do wrong?
buys:
id
7602962fb83ac2e2a0cb44158ca88464
bc8a731e4c7e6f6b96e56ebe7f766bcd
a703114aa8a03495c3e042647212fa63
77138e9245857e5449e9474293e31e19
chunk:
id date
7602962fb83ac2e2a0cb44158ca88464 01.01.2016
7602962fb83ac2e2a0cb44158ca88464 02.01.2016
7602962fb83ac2e2a0cb44158ca88464 03.01.2016
77138e9245857e5449e9474293e31e19 09.05.2016
77138e9245857e5449e9474293e31e19 10.05.2016
671cfd6702c74f017209c2f1a888c279 10.01.2016
671cfd6702c74f017209c2f1a888c279 11.01.2016
029cfd6702c68f243423c2f1a234c232 11.03.2016
And I need to get
7602962fb83ac2e2a0cb44158ca88464 01.01.2016
7602962fb83ac2e2a0cb44158ca88464 02.01.2016
7602962fb83ac2e2a0cb44158ca88464 03.01.2016
77138e9245857e5449e9474293e31e19 09.05.2016
77138e9245857e5449e9474293e31e19 10.05.2016
how=lefttopd.merge.idorID? I can't reproduce it. Could you prepare a small example and paste the output ofprint(buys),print(chunk), andpd.merge(buys, chunk, left_on='id', right_on='ID').