I am working on a base-datatable with a VARBINARY variable. Now I want to read the table via SQLAlchemy into a pandas dataframe. Going the usual way
df = pandas.read_sql_query("select key from xxx", engine)
I get an uninterpretable memoryview as data type. I can convert this via lambda function
df.key.apply(lambda x: x.tobytes().hex())
into the desired readable format. But I would like to know if the casting can also be placed directly into the pandas.read_sql_query()-statement:
via numpy dtypes or maybe
directly into the SQL-query
Many greetings and best thanks