I have a dataframe with 5 columns, one of which is 'TABLE_NAME'. That column has values such as:
A_value1
B_value1
B_value2
A_value150
I want to print those that start with 'A_' only.
I tried this but its returning the following:
ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
Here is the code:
value = 'A_'
for index, row in df.iterrows():
if df.loc[df['TABLE_NAME'].str.contains(value)]:
print('y')
else:
print('n')