Having a question. I am having a list of records and there is another list of records which i am comparing the first list. When i write line(inside row reading of first list:
for index, row in output_merged_po.iterrows():
stock = output_merged_stock[output_merged_stock['PN_STRIPPED']==row['PN_STRIPPED']][['Whs']]
print stock
I get result
Whs
11763 VLN
Where 11763 is output_merged_stock id number and Whs is name of whs where PN_stripped matches.
But i fail to extract data for further processing. I just want to write simple if statetement where i can ask if whs = VLN
. I wrote:
if stock[['Whs']] == 'VLN':
print stock
I got error: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
I wrote:
if stock == 'VLN':
print stock
And i got again : The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
How should i write if statement if i want to get result 'VLN'? As for example there are sometimes cases when stock output is sometimes 3 whs, where 2 of them are 'VLN' and third is 'XRS' and on that case i should see of 'if' output 2 times VLN without XRS