I have the following script:
import pandas as pd
import numpy as np
df = pd.read_csv("scedon_etoimo.csv")
df.replace(np.nan, '', regex=True)
if df[(df['ship_from'].str.contains('<')) | (df['ship_from'].str.contains(' '))]:
print(df['ship_from'])
In the csv I have the last column which contains either string or NaN or < Name_of_a_country / strong> (my purpose is to replace those with another string). But when I run it to see if my statement works, I get the following error :
ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all()
I have already checked this topic
Any help?