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
1












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



enter image description here



the address column into



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










share|improve this question









New contributor




Orla Rafferty is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • 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 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






  • 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















up vote
-2
down vote

favorite
1












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



enter image description here



the address column into



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










share|improve this question









New contributor




Orla Rafferty is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • 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 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






  • 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













up vote
-2
down vote

favorite
1









up vote
-2
down vote

favorite
1






1





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



enter image description here



the address column into



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










share|improve this question









New contributor




Orla Rafferty is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











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



enter image description here



the address column into



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






share|improve this question









New contributor




Orla Rafferty is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Orla Rafferty is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited Nov 5 at 17:15









Derlin

6,08121632




6,08121632






New contributor




Orla Rafferty is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Nov 5 at 17:00









Orla Rafferty

11




11




New contributor




Orla Rafferty is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Orla Rafferty is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Orla Rafferty is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • 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 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






  • 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


















  • 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 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






  • 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
















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

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});






Orla Rafferty is a new contributor. Be nice, and check out our Code of Conduct.










 

draft saved


draft discarded


















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





































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.










 

draft saved


draft discarded


















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.















 


draft saved


draft discarded














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




















































































這個網誌中的熱門文章

Xamarin.form Move up view when keyboard appear

Post-Redirect-Get with Spring WebFlux and Thymeleaf

Anylogic : not able to use stopDelay()