These are chat archives for FreeCodeCamp/DataScience

28th
Jan 2019
evaristoc
@evaristoc
Jan 28 21:30

Hi People,

I HAD TO share this one:
https://www.coursera.org/learn/bayesian-methods-in-machine-learning

This is A "MUST", really! Actually, work on the Specialization if you can.

Excellent!

evaristoc
@evaristoc
Jan 28 21:42

@simeydk There are "join", "merge" and "concat" methods in pandas.

I think join should be your way to go. Otherwise check merge.

https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.join.html

There is a parameter to say how the join should be ("how").
If I remember correctly, merge is set to inner join by default? Dont remember.

There is also a "on" parameter, which in your case should be made as the PROD_ID if I am right. Otherwise use xsuffix.

You can make a selection of columns you want to compare too. If A and B are both different tables, both should be as pandas DataFrames.

Right now I don't remember how to introduce the condition but it is also possible with pandas. But I suspect is not as efficient.

Having a quick look to remind me, I think you will have to make a full left join and then apply a conditional selection over the resulting data frame:
https://stackoverflow.com/questions/23508351/how-to-do-a-conditional-join-in-python-pandas

I suggest you to investigate more, probably there is something new that I dont know?

Hope this helps.