using one element from one datafram to find all the information in the other datafram? Python

  data-analysis, dataframe, pandas, python, python-3.x

I have 2 dataframe in python by running 2 sql queries.
Table A:

Name Email Code
A E E1,E2,E3
B F F1,F2
C G G1

Table B:

Info1 Code Info2
E1
F1
E2
E3
G1
F2

Because they are dataframe in Python, I would like to read the email one by one, and find its Code list/Array in TableA.
And use every elements in the list/array to find all the data in Table B, create excels and send to information’s host.
For example,
I would to get the result excel like below and send it to E.

Info1 Code Info2
E1
E2
E3

For example,
I would to get the result excel like below and send it to F.

Info1 Code Info2
F1
F2

For example,
I would to get the result excel like below and send it to G.

Info1 Code Info2
G1

Please use dataframe in Python.
THANK YOU SO MUCH

Source: Python Questions

LEAVE A COMMENT