Compare column values based on list in Pandas dataframe












2















I have 2 dataframes as below:



df1:



ID    list     value  listA  valueA  listB   valueB
1 list1 D1 list1 D1 list1 D1
2 list2 D1
3 list1 D3 list2 D3
4 list2 D1 list2 D1 list1 D3
5 list2 D2 list2 D2 list2 D2
6 list2 D3 list1 D3 list1 D4


df2:



list1  list2
D1 456
D2 D2
33 D31
D4 245
EE D5
D5 D6


I'm trying to generate a final df based on the below validations



-> If value of list in df1 is list1, then the corresponding data of "value" in df1 should be one among the values of the list1 column in df2 3.



-> If value of list in df1 is list2, then the corresponding data of "value" in df1 should be one among the values of the list2 column in df2.



Expected Result df:



ID   list   value  listA  valueA  listB  valueB Error
1 list1 D1 list1 D1 list1 D1 no mismatch
2 list2 D1 valueA mismatch
3 list1 D3 list2 D3 value, valueB mismatch
4 list2 D1 list2 D1 list1 D3 value,valueA&valueB mismatch
5 list2 D2 list2 D2 list2 D2 no mismatch
6 list2 D3 list1 D3 list1 D4 value, valueA mismatch









share|improve this question

























  • Why asking same question twice? Your previous question

    – AkshayNevrekar
    Nov 22 '18 at 11:49






  • 1





    @Sociopath - Yes, I did split the question into two, as they deal with different validations, just to avoid confusion

    – Osceria
    Nov 22 '18 at 11:55
















2















I have 2 dataframes as below:



df1:



ID    list     value  listA  valueA  listB   valueB
1 list1 D1 list1 D1 list1 D1
2 list2 D1
3 list1 D3 list2 D3
4 list2 D1 list2 D1 list1 D3
5 list2 D2 list2 D2 list2 D2
6 list2 D3 list1 D3 list1 D4


df2:



list1  list2
D1 456
D2 D2
33 D31
D4 245
EE D5
D5 D6


I'm trying to generate a final df based on the below validations



-> If value of list in df1 is list1, then the corresponding data of "value" in df1 should be one among the values of the list1 column in df2 3.



-> If value of list in df1 is list2, then the corresponding data of "value" in df1 should be one among the values of the list2 column in df2.



Expected Result df:



ID   list   value  listA  valueA  listB  valueB Error
1 list1 D1 list1 D1 list1 D1 no mismatch
2 list2 D1 valueA mismatch
3 list1 D3 list2 D3 value, valueB mismatch
4 list2 D1 list2 D1 list1 D3 value,valueA&valueB mismatch
5 list2 D2 list2 D2 list2 D2 no mismatch
6 list2 D3 list1 D3 list1 D4 value, valueA mismatch









share|improve this question

























  • Why asking same question twice? Your previous question

    – AkshayNevrekar
    Nov 22 '18 at 11:49






  • 1





    @Sociopath - Yes, I did split the question into two, as they deal with different validations, just to avoid confusion

    – Osceria
    Nov 22 '18 at 11:55














2












2








2








I have 2 dataframes as below:



df1:



ID    list     value  listA  valueA  listB   valueB
1 list1 D1 list1 D1 list1 D1
2 list2 D1
3 list1 D3 list2 D3
4 list2 D1 list2 D1 list1 D3
5 list2 D2 list2 D2 list2 D2
6 list2 D3 list1 D3 list1 D4


df2:



list1  list2
D1 456
D2 D2
33 D31
D4 245
EE D5
D5 D6


I'm trying to generate a final df based on the below validations



-> If value of list in df1 is list1, then the corresponding data of "value" in df1 should be one among the values of the list1 column in df2 3.



-> If value of list in df1 is list2, then the corresponding data of "value" in df1 should be one among the values of the list2 column in df2.



Expected Result df:



ID   list   value  listA  valueA  listB  valueB Error
1 list1 D1 list1 D1 list1 D1 no mismatch
2 list2 D1 valueA mismatch
3 list1 D3 list2 D3 value, valueB mismatch
4 list2 D1 list2 D1 list1 D3 value,valueA&valueB mismatch
5 list2 D2 list2 D2 list2 D2 no mismatch
6 list2 D3 list1 D3 list1 D4 value, valueA mismatch









share|improve this question
















I have 2 dataframes as below:



df1:



ID    list     value  listA  valueA  listB   valueB
1 list1 D1 list1 D1 list1 D1
2 list2 D1
3 list1 D3 list2 D3
4 list2 D1 list2 D1 list1 D3
5 list2 D2 list2 D2 list2 D2
6 list2 D3 list1 D3 list1 D4


df2:



list1  list2
D1 456
D2 D2
33 D31
D4 245
EE D5
D5 D6


I'm trying to generate a final df based on the below validations



-> If value of list in df1 is list1, then the corresponding data of "value" in df1 should be one among the values of the list1 column in df2 3.



-> If value of list in df1 is list2, then the corresponding data of "value" in df1 should be one among the values of the list2 column in df2.



Expected Result df:



ID   list   value  listA  valueA  listB  valueB Error
1 list1 D1 list1 D1 list1 D1 no mismatch
2 list2 D1 valueA mismatch
3 list1 D3 list2 D3 value, valueB mismatch
4 list2 D1 list2 D1 list1 D3 value,valueA&valueB mismatch
5 list2 D2 list2 D2 list2 D2 no mismatch
6 list2 D3 list1 D3 list1 D4 value, valueA mismatch






pandas dataframe






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 5 '18 at 14:30







Osceria

















asked Nov 22 '18 at 11:35









OsceriaOsceria

599




599













  • Why asking same question twice? Your previous question

    – AkshayNevrekar
    Nov 22 '18 at 11:49






  • 1





    @Sociopath - Yes, I did split the question into two, as they deal with different validations, just to avoid confusion

    – Osceria
    Nov 22 '18 at 11:55



















  • Why asking same question twice? Your previous question

    – AkshayNevrekar
    Nov 22 '18 at 11:49






  • 1





    @Sociopath - Yes, I did split the question into two, as they deal with different validations, just to avoid confusion

    – Osceria
    Nov 22 '18 at 11:55

















Why asking same question twice? Your previous question

– AkshayNevrekar
Nov 22 '18 at 11:49





Why asking same question twice? Your previous question

– AkshayNevrekar
Nov 22 '18 at 11:49




1




1





@Sociopath - Yes, I did split the question into two, as they deal with different validations, just to avoid confusion

– Osceria
Nov 22 '18 at 11:55





@Sociopath - Yes, I did split the question into two, as they deal with different validations, just to avoid confusion

– Osceria
Nov 22 '18 at 11:55












2 Answers
2






active

oldest

votes


















0














Use GroupBy.transform with custom function with isin for boolean mask and set values by numpy.where:



m = df1.groupby('list')['value'].transform(lambda x: x.isin(df2[x.name]))
df1['Error'] = np.where(m, 'No mismatch with df2','list mismatch with df2')
print (df1)
ID list value Error
0 1 list1 D1 No mismatch with df2
1 2 list1 D2 No mismatch with df2
2 3 list1 D3 list mismatch with df2
3 4 list2 D1 list mismatch with df2
4 5 list2 D2 No mismatch with df2
5 6 list2 D3 list mismatch with df2





share|improve this answer



















  • 1





    expected results are satisfied

    – Osceria
    Nov 22 '18 at 13:45











  • the code throws an error when the values are made empty for any row in df1. error - "Length mismatch: Expected axis has 5 elements, new values have 6 elements". Any help with this? @jezrael

    – Osceria
    Dec 3 '18 at 5:38













  • @Osceria - Problem is missing values are excluded in groupby, solution is df2 = df2.assign(missing=np.nan) and m = df1['value'].groupby(df1['list'].fillna('missing')).transform(lambda x: x.isin(df2[x.name]))

    – jezrael
    Dec 3 '18 at 6:14











  • This change marks the rows with empty values as "list mismatch". Rather it should ignore the rows from validation that have empty values.- @Jezrael

    – Osceria
    Dec 3 '18 at 13:20













  • @Osceria - Can you check m1 = df1['list'].notnull() df11 = df1[m1] m = df11.groupby('list')['value'].transform(lambda x: x.isin(df2[x.name])) df1.loc[m1, 'Error'] = np.where(m, 'No mismatch with df2','list mismatch with df2') ?

    – jezrael
    Dec 3 '18 at 13:36



















0














You can do the following:



def fun(x, df2):
if x['value'] not in df2[x['list']].tolist():
return 'list mismatch with df2'
else:
return 'No mismatch with df2'

df['Error'] = df.apply(lambda x: fun(x, df2), axis = 1)
print(df)

ID list value Error
0 1 list1 D1 No mismatch with df2
1 2 list1 D2 No mismatch with df2
2 3 list1 D3 list mismatch with df2
3 4 list2 D1 list mismatch with df2
4 5 list2 D2 No mismatch with df2
5 6 list2 D3 list mismatch with df2





share|improve this answer


























  • I get this error - AttributeError: ("'Series' object has no attribute 'list'", 'occurred at index 0')

    – Osceria
    Nov 22 '18 at 12:25











  • Does it worlk now? @Osceria

    – yatu
    Nov 22 '18 at 12:27











  • Yes Alexandre, the code works fine now.

    – Osceria
    Nov 22 '18 at 13:44











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',
autoActivateHeartbeat: false,
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
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53430107%2fcompare-column-values-based-on-list-in-pandas-dataframe%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














Use GroupBy.transform with custom function with isin for boolean mask and set values by numpy.where:



m = df1.groupby('list')['value'].transform(lambda x: x.isin(df2[x.name]))
df1['Error'] = np.where(m, 'No mismatch with df2','list mismatch with df2')
print (df1)
ID list value Error
0 1 list1 D1 No mismatch with df2
1 2 list1 D2 No mismatch with df2
2 3 list1 D3 list mismatch with df2
3 4 list2 D1 list mismatch with df2
4 5 list2 D2 No mismatch with df2
5 6 list2 D3 list mismatch with df2





share|improve this answer



















  • 1





    expected results are satisfied

    – Osceria
    Nov 22 '18 at 13:45











  • the code throws an error when the values are made empty for any row in df1. error - "Length mismatch: Expected axis has 5 elements, new values have 6 elements". Any help with this? @jezrael

    – Osceria
    Dec 3 '18 at 5:38













  • @Osceria - Problem is missing values are excluded in groupby, solution is df2 = df2.assign(missing=np.nan) and m = df1['value'].groupby(df1['list'].fillna('missing')).transform(lambda x: x.isin(df2[x.name]))

    – jezrael
    Dec 3 '18 at 6:14











  • This change marks the rows with empty values as "list mismatch". Rather it should ignore the rows from validation that have empty values.- @Jezrael

    – Osceria
    Dec 3 '18 at 13:20













  • @Osceria - Can you check m1 = df1['list'].notnull() df11 = df1[m1] m = df11.groupby('list')['value'].transform(lambda x: x.isin(df2[x.name])) df1.loc[m1, 'Error'] = np.where(m, 'No mismatch with df2','list mismatch with df2') ?

    – jezrael
    Dec 3 '18 at 13:36
















0














Use GroupBy.transform with custom function with isin for boolean mask and set values by numpy.where:



m = df1.groupby('list')['value'].transform(lambda x: x.isin(df2[x.name]))
df1['Error'] = np.where(m, 'No mismatch with df2','list mismatch with df2')
print (df1)
ID list value Error
0 1 list1 D1 No mismatch with df2
1 2 list1 D2 No mismatch with df2
2 3 list1 D3 list mismatch with df2
3 4 list2 D1 list mismatch with df2
4 5 list2 D2 No mismatch with df2
5 6 list2 D3 list mismatch with df2





share|improve this answer



















  • 1





    expected results are satisfied

    – Osceria
    Nov 22 '18 at 13:45











  • the code throws an error when the values are made empty for any row in df1. error - "Length mismatch: Expected axis has 5 elements, new values have 6 elements". Any help with this? @jezrael

    – Osceria
    Dec 3 '18 at 5:38













  • @Osceria - Problem is missing values are excluded in groupby, solution is df2 = df2.assign(missing=np.nan) and m = df1['value'].groupby(df1['list'].fillna('missing')).transform(lambda x: x.isin(df2[x.name]))

    – jezrael
    Dec 3 '18 at 6:14











  • This change marks the rows with empty values as "list mismatch". Rather it should ignore the rows from validation that have empty values.- @Jezrael

    – Osceria
    Dec 3 '18 at 13:20













  • @Osceria - Can you check m1 = df1['list'].notnull() df11 = df1[m1] m = df11.groupby('list')['value'].transform(lambda x: x.isin(df2[x.name])) df1.loc[m1, 'Error'] = np.where(m, 'No mismatch with df2','list mismatch with df2') ?

    – jezrael
    Dec 3 '18 at 13:36














0












0








0







Use GroupBy.transform with custom function with isin for boolean mask and set values by numpy.where:



m = df1.groupby('list')['value'].transform(lambda x: x.isin(df2[x.name]))
df1['Error'] = np.where(m, 'No mismatch with df2','list mismatch with df2')
print (df1)
ID list value Error
0 1 list1 D1 No mismatch with df2
1 2 list1 D2 No mismatch with df2
2 3 list1 D3 list mismatch with df2
3 4 list2 D1 list mismatch with df2
4 5 list2 D2 No mismatch with df2
5 6 list2 D3 list mismatch with df2





share|improve this answer













Use GroupBy.transform with custom function with isin for boolean mask and set values by numpy.where:



m = df1.groupby('list')['value'].transform(lambda x: x.isin(df2[x.name]))
df1['Error'] = np.where(m, 'No mismatch with df2','list mismatch with df2')
print (df1)
ID list value Error
0 1 list1 D1 No mismatch with df2
1 2 list1 D2 No mismatch with df2
2 3 list1 D3 list mismatch with df2
3 4 list2 D1 list mismatch with df2
4 5 list2 D2 No mismatch with df2
5 6 list2 D3 list mismatch with df2






share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 22 '18 at 11:47









jezraeljezrael

342k25297369




342k25297369








  • 1





    expected results are satisfied

    – Osceria
    Nov 22 '18 at 13:45











  • the code throws an error when the values are made empty for any row in df1. error - "Length mismatch: Expected axis has 5 elements, new values have 6 elements". Any help with this? @jezrael

    – Osceria
    Dec 3 '18 at 5:38













  • @Osceria - Problem is missing values are excluded in groupby, solution is df2 = df2.assign(missing=np.nan) and m = df1['value'].groupby(df1['list'].fillna('missing')).transform(lambda x: x.isin(df2[x.name]))

    – jezrael
    Dec 3 '18 at 6:14











  • This change marks the rows with empty values as "list mismatch". Rather it should ignore the rows from validation that have empty values.- @Jezrael

    – Osceria
    Dec 3 '18 at 13:20













  • @Osceria - Can you check m1 = df1['list'].notnull() df11 = df1[m1] m = df11.groupby('list')['value'].transform(lambda x: x.isin(df2[x.name])) df1.loc[m1, 'Error'] = np.where(m, 'No mismatch with df2','list mismatch with df2') ?

    – jezrael
    Dec 3 '18 at 13:36














  • 1





    expected results are satisfied

    – Osceria
    Nov 22 '18 at 13:45











  • the code throws an error when the values are made empty for any row in df1. error - "Length mismatch: Expected axis has 5 elements, new values have 6 elements". Any help with this? @jezrael

    – Osceria
    Dec 3 '18 at 5:38













  • @Osceria - Problem is missing values are excluded in groupby, solution is df2 = df2.assign(missing=np.nan) and m = df1['value'].groupby(df1['list'].fillna('missing')).transform(lambda x: x.isin(df2[x.name]))

    – jezrael
    Dec 3 '18 at 6:14











  • This change marks the rows with empty values as "list mismatch". Rather it should ignore the rows from validation that have empty values.- @Jezrael

    – Osceria
    Dec 3 '18 at 13:20













  • @Osceria - Can you check m1 = df1['list'].notnull() df11 = df1[m1] m = df11.groupby('list')['value'].transform(lambda x: x.isin(df2[x.name])) df1.loc[m1, 'Error'] = np.where(m, 'No mismatch with df2','list mismatch with df2') ?

    – jezrael
    Dec 3 '18 at 13:36








1




1





expected results are satisfied

– Osceria
Nov 22 '18 at 13:45





expected results are satisfied

– Osceria
Nov 22 '18 at 13:45













the code throws an error when the values are made empty for any row in df1. error - "Length mismatch: Expected axis has 5 elements, new values have 6 elements". Any help with this? @jezrael

– Osceria
Dec 3 '18 at 5:38







the code throws an error when the values are made empty for any row in df1. error - "Length mismatch: Expected axis has 5 elements, new values have 6 elements". Any help with this? @jezrael

– Osceria
Dec 3 '18 at 5:38















@Osceria - Problem is missing values are excluded in groupby, solution is df2 = df2.assign(missing=np.nan) and m = df1['value'].groupby(df1['list'].fillna('missing')).transform(lambda x: x.isin(df2[x.name]))

– jezrael
Dec 3 '18 at 6:14





@Osceria - Problem is missing values are excluded in groupby, solution is df2 = df2.assign(missing=np.nan) and m = df1['value'].groupby(df1['list'].fillna('missing')).transform(lambda x: x.isin(df2[x.name]))

– jezrael
Dec 3 '18 at 6:14













This change marks the rows with empty values as "list mismatch". Rather it should ignore the rows from validation that have empty values.- @Jezrael

– Osceria
Dec 3 '18 at 13:20







This change marks the rows with empty values as "list mismatch". Rather it should ignore the rows from validation that have empty values.- @Jezrael

– Osceria
Dec 3 '18 at 13:20















@Osceria - Can you check m1 = df1['list'].notnull() df11 = df1[m1] m = df11.groupby('list')['value'].transform(lambda x: x.isin(df2[x.name])) df1.loc[m1, 'Error'] = np.where(m, 'No mismatch with df2','list mismatch with df2') ?

– jezrael
Dec 3 '18 at 13:36





@Osceria - Can you check m1 = df1['list'].notnull() df11 = df1[m1] m = df11.groupby('list')['value'].transform(lambda x: x.isin(df2[x.name])) df1.loc[m1, 'Error'] = np.where(m, 'No mismatch with df2','list mismatch with df2') ?

– jezrael
Dec 3 '18 at 13:36













0














You can do the following:



def fun(x, df2):
if x['value'] not in df2[x['list']].tolist():
return 'list mismatch with df2'
else:
return 'No mismatch with df2'

df['Error'] = df.apply(lambda x: fun(x, df2), axis = 1)
print(df)

ID list value Error
0 1 list1 D1 No mismatch with df2
1 2 list1 D2 No mismatch with df2
2 3 list1 D3 list mismatch with df2
3 4 list2 D1 list mismatch with df2
4 5 list2 D2 No mismatch with df2
5 6 list2 D3 list mismatch with df2





share|improve this answer


























  • I get this error - AttributeError: ("'Series' object has no attribute 'list'", 'occurred at index 0')

    – Osceria
    Nov 22 '18 at 12:25











  • Does it worlk now? @Osceria

    – yatu
    Nov 22 '18 at 12:27











  • Yes Alexandre, the code works fine now.

    – Osceria
    Nov 22 '18 at 13:44
















0














You can do the following:



def fun(x, df2):
if x['value'] not in df2[x['list']].tolist():
return 'list mismatch with df2'
else:
return 'No mismatch with df2'

df['Error'] = df.apply(lambda x: fun(x, df2), axis = 1)
print(df)

ID list value Error
0 1 list1 D1 No mismatch with df2
1 2 list1 D2 No mismatch with df2
2 3 list1 D3 list mismatch with df2
3 4 list2 D1 list mismatch with df2
4 5 list2 D2 No mismatch with df2
5 6 list2 D3 list mismatch with df2





share|improve this answer


























  • I get this error - AttributeError: ("'Series' object has no attribute 'list'", 'occurred at index 0')

    – Osceria
    Nov 22 '18 at 12:25











  • Does it worlk now? @Osceria

    – yatu
    Nov 22 '18 at 12:27











  • Yes Alexandre, the code works fine now.

    – Osceria
    Nov 22 '18 at 13:44














0












0








0







You can do the following:



def fun(x, df2):
if x['value'] not in df2[x['list']].tolist():
return 'list mismatch with df2'
else:
return 'No mismatch with df2'

df['Error'] = df.apply(lambda x: fun(x, df2), axis = 1)
print(df)

ID list value Error
0 1 list1 D1 No mismatch with df2
1 2 list1 D2 No mismatch with df2
2 3 list1 D3 list mismatch with df2
3 4 list2 D1 list mismatch with df2
4 5 list2 D2 No mismatch with df2
5 6 list2 D3 list mismatch with df2





share|improve this answer















You can do the following:



def fun(x, df2):
if x['value'] not in df2[x['list']].tolist():
return 'list mismatch with df2'
else:
return 'No mismatch with df2'

df['Error'] = df.apply(lambda x: fun(x, df2), axis = 1)
print(df)

ID list value Error
0 1 list1 D1 No mismatch with df2
1 2 list1 D2 No mismatch with df2
2 3 list1 D3 list mismatch with df2
3 4 list2 D1 list mismatch with df2
4 5 list2 D2 No mismatch with df2
5 6 list2 D3 list mismatch with df2






share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 22 '18 at 13:15

























answered Nov 22 '18 at 11:47









yatuyatu

11.7k31238




11.7k31238













  • I get this error - AttributeError: ("'Series' object has no attribute 'list'", 'occurred at index 0')

    – Osceria
    Nov 22 '18 at 12:25











  • Does it worlk now? @Osceria

    – yatu
    Nov 22 '18 at 12:27











  • Yes Alexandre, the code works fine now.

    – Osceria
    Nov 22 '18 at 13:44



















  • I get this error - AttributeError: ("'Series' object has no attribute 'list'", 'occurred at index 0')

    – Osceria
    Nov 22 '18 at 12:25











  • Does it worlk now? @Osceria

    – yatu
    Nov 22 '18 at 12:27











  • Yes Alexandre, the code works fine now.

    – Osceria
    Nov 22 '18 at 13:44

















I get this error - AttributeError: ("'Series' object has no attribute 'list'", 'occurred at index 0')

– Osceria
Nov 22 '18 at 12:25





I get this error - AttributeError: ("'Series' object has no attribute 'list'", 'occurred at index 0')

– Osceria
Nov 22 '18 at 12:25













Does it worlk now? @Osceria

– yatu
Nov 22 '18 at 12:27





Does it worlk now? @Osceria

– yatu
Nov 22 '18 at 12:27













Yes Alexandre, the code works fine now.

– Osceria
Nov 22 '18 at 13:44





Yes Alexandre, the code works fine now.

– Osceria
Nov 22 '18 at 13:44


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53430107%2fcompare-column-values-based-on-list-in-pandas-dataframe%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

MongoDB - Not Authorized To Execute Command

How to fix TextFormField cause rebuild widget in Flutter

Npm cannot find a required file even through it is in the searched directory