Click here to Skip to main content
15,881,600 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
For example if a value from column b is in column a then print if value is present.

-URL_Sites_List.insert(2,'MetaData','',True)
Perform = Perform2.apply(lambda x: x.astype(str).str.lower())
URL_Sites_List.loc[URL_Sites_List['URL'].str.contains[Perform('Banyan Hill Publishing')], 'MetaData'] = 'Banyan Hill Publishing'



Can I use another method for this? if URL list contains a vlies from the dataframe perform('Banyan hill') the assign Banyan hill in the new column MetaData.

What I have tried:

for i, row in URL_Sites_List.iterrows():
    a = URL_Sites_List.loc[(Perform["Banyan Hill Publishing"] in URL_Sites_List['URL']),URL_Sites_List['MetaData']] = 'Banyan Hill Publishing'


also tried this,

a=Perform.iloc[:]
b=URL_Sites_List['URL'].iloc[:]

for i, row in b.iterrows:
    if a in b:
        print("Present")
    else:
        print("Not Present")
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900