need to be able to do a lookup on an id in one df and an address in another df to match location to an id
up vote
-2
down vote
favorite
This is the df I want to use as the ID to add and the other one is the df with the address in it
the first df has multiple rows relating to one address in the other df so I need to do a vlookup to match the ids to addresses
python pandas vlookup
New contributor
|
show 1 more comment
up vote
-2
down vote
favorite
This is the df I want to use as the ID to add and the other one is the df with the address in it
the first df has multiple rows relating to one address in the other df so I need to do a vlookup to match the ids to addresses
python pandas vlookup
New contributor
Probably something in here
– G. Anderson
Nov 5 at 17:05
I think this just relates to concatenation which I am already familiar with, I need to look up the address data frame to match the ids in the other to each address, I don't know if im even explaining this right
– Orla Rafferty
Nov 5 at 17:07
It's very unclear what you're asking, from your description it sounds like ajoin
ormerge
on ID and Address. Otherwise, you could use something like.where()
to get the indices and index into the other DF. Generally it's a good idea to post the code you've tried and your expected inputs and outputs (in the question, not as images) to help clarify
– G. Anderson
Nov 5 at 17:14
I haven't posted on this before which explains it probably. I have posted a photo of the main df.
– Orla Rafferty
Nov 5 at 17:16
1
Apologies, but again I have to say that samples should be posted as code/text in the question, not as images, so that people can run code against your examples. From your description, though, it sounds like you want something like a merge, as indf3=pd.merge(df2, df1, left_on='PracNo', right_on='PRACTICE')
or something similar
– G. Anderson
Nov 5 at 17:23
|
show 1 more comment
up vote
-2
down vote
favorite
up vote
-2
down vote
favorite
This is the df I want to use as the ID to add and the other one is the df with the address in it
the first df has multiple rows relating to one address in the other df so I need to do a vlookup to match the ids to addresses
python pandas vlookup
New contributor
This is the df I want to use as the ID to add and the other one is the df with the address in it
the first df has multiple rows relating to one address in the other df so I need to do a vlookup to match the ids to addresses
python pandas vlookup
python pandas vlookup
New contributor
New contributor
edited Nov 5 at 17:15
Derlin
6,08121632
6,08121632
New contributor
asked Nov 5 at 17:00
Orla Rafferty
11
11
New contributor
New contributor
Probably something in here
– G. Anderson
Nov 5 at 17:05
I think this just relates to concatenation which I am already familiar with, I need to look up the address data frame to match the ids in the other to each address, I don't know if im even explaining this right
– Orla Rafferty
Nov 5 at 17:07
It's very unclear what you're asking, from your description it sounds like ajoin
ormerge
on ID and Address. Otherwise, you could use something like.where()
to get the indices and index into the other DF. Generally it's a good idea to post the code you've tried and your expected inputs and outputs (in the question, not as images) to help clarify
– G. Anderson
Nov 5 at 17:14
I haven't posted on this before which explains it probably. I have posted a photo of the main df.
– Orla Rafferty
Nov 5 at 17:16
1
Apologies, but again I have to say that samples should be posted as code/text in the question, not as images, so that people can run code against your examples. From your description, though, it sounds like you want something like a merge, as indf3=pd.merge(df2, df1, left_on='PracNo', right_on='PRACTICE')
or something similar
– G. Anderson
Nov 5 at 17:23
|
show 1 more comment
Probably something in here
– G. Anderson
Nov 5 at 17:05
I think this just relates to concatenation which I am already familiar with, I need to look up the address data frame to match the ids in the other to each address, I don't know if im even explaining this right
– Orla Rafferty
Nov 5 at 17:07
It's very unclear what you're asking, from your description it sounds like ajoin
ormerge
on ID and Address. Otherwise, you could use something like.where()
to get the indices and index into the other DF. Generally it's a good idea to post the code you've tried and your expected inputs and outputs (in the question, not as images) to help clarify
– G. Anderson
Nov 5 at 17:14
I haven't posted on this before which explains it probably. I have posted a photo of the main df.
– Orla Rafferty
Nov 5 at 17:16
1
Apologies, but again I have to say that samples should be posted as code/text in the question, not as images, so that people can run code against your examples. From your description, though, it sounds like you want something like a merge, as indf3=pd.merge(df2, df1, left_on='PracNo', right_on='PRACTICE')
or something similar
– G. Anderson
Nov 5 at 17:23
Probably something in here
– G. Anderson
Nov 5 at 17:05
Probably something in here
– G. Anderson
Nov 5 at 17:05
I think this just relates to concatenation which I am already familiar with, I need to look up the address data frame to match the ids in the other to each address, I don't know if im even explaining this right
– Orla Rafferty
Nov 5 at 17:07
I think this just relates to concatenation which I am already familiar with, I need to look up the address data frame to match the ids in the other to each address, I don't know if im even explaining this right
– Orla Rafferty
Nov 5 at 17:07
It's very unclear what you're asking, from your description it sounds like a
join
or merge
on ID and Address. Otherwise, you could use something like .where()
to get the indices and index into the other DF. Generally it's a good idea to post the code you've tried and your expected inputs and outputs (in the question, not as images) to help clarify– G. Anderson
Nov 5 at 17:14
It's very unclear what you're asking, from your description it sounds like a
join
or merge
on ID and Address. Otherwise, you could use something like .where()
to get the indices and index into the other DF. Generally it's a good idea to post the code you've tried and your expected inputs and outputs (in the question, not as images) to help clarify– G. Anderson
Nov 5 at 17:14
I haven't posted on this before which explains it probably. I have posted a photo of the main df.
– Orla Rafferty
Nov 5 at 17:16
I haven't posted on this before which explains it probably. I have posted a photo of the main df.
– Orla Rafferty
Nov 5 at 17:16
1
1
Apologies, but again I have to say that samples should be posted as code/text in the question, not as images, so that people can run code against your examples. From your description, though, it sounds like you want something like a merge, as in
df3=pd.merge(df2, df1, left_on='PracNo', right_on='PRACTICE')
or something similar– G. Anderson
Nov 5 at 17:23
Apologies, but again I have to say that samples should be posted as code/text in the question, not as images, so that people can run code against your examples. From your description, though, it sounds like you want something like a merge, as in
df3=pd.merge(df2, df1, left_on='PracNo', right_on='PRACTICE')
or something similar– G. Anderson
Nov 5 at 17:23
|
show 1 more comment
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Orla Rafferty is a new contributor. Be nice, and check out our Code of Conduct.
Orla Rafferty is a new contributor. Be nice, and check out our Code of Conduct.
Orla Rafferty is a new contributor. Be nice, and check out our Code of Conduct.
Orla Rafferty is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53158907%2fneed-to-be-able-to-do-a-lookup-on-an-id-in-one-df-and-an-address-in-another-df-t%23new-answer', 'question_page');
}
);
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Probably something in here
– G. Anderson
Nov 5 at 17:05
I think this just relates to concatenation which I am already familiar with, I need to look up the address data frame to match the ids in the other to each address, I don't know if im even explaining this right
– Orla Rafferty
Nov 5 at 17:07
It's very unclear what you're asking, from your description it sounds like a
join
ormerge
on ID and Address. Otherwise, you could use something like.where()
to get the indices and index into the other DF. Generally it's a good idea to post the code you've tried and your expected inputs and outputs (in the question, not as images) to help clarify– G. Anderson
Nov 5 at 17:14
I haven't posted on this before which explains it probably. I have posted a photo of the main df.
– Orla Rafferty
Nov 5 at 17:16
1
Apologies, but again I have to say that samples should be posted as code/text in the question, not as images, so that people can run code against your examples. From your description, though, it sounds like you want something like a merge, as in
df3=pd.merge(df2, df1, left_on='PracNo', right_on='PRACTICE')
or something similar– G. Anderson
Nov 5 at 17:23