I'm trying to use a select query to select a currency code (USD, GBP etc) from a database and use it to go straight into a converter. Instead of just getting 'USD' etc, I get a little table that looks like:
Currency | |
---|---|
0 | GBP |
Is there a way to just return 'GBP'? The current query result doesn't work in my converter. I've tried printing it normally and I've tried printing it as a string. Thank you!
My code is:
a = input("Enter ID of sending customer: ")
a2 = pd.read_sql("SELECT Currency FROM Customers WHERE \
ID='{}'".format(a), con)
print(str(a2))
print(a2)