db = pd.read_csv('/Users/janaina/Documents/App/Data/cosmetics.csv')
nsdb = pd.read_excel('/Users/janaina/Documents/App/Data/Non Sensitising
Products.xlsx')
def addnsproduct(nsp):
if nsp in db.Name.values :
print("Recognised product")
nsdb = nsdb.append(db.loc[db['Name'] == nsp])
else :
print("Not in database")
nsp = input("Enter product that does not sensitise your skin: ")
addnsproduct(nsp)
print(nsdb)
I get an error saying that nsdb (the one after the =) is not defined.
Please note that nsdb is a blank file, no columns.
Thanks!
Aucun commentaire:
Enregistrer un commentaire