sql = "select ppicture,nurse_id from nurse" df = pd.read_sql(sql, conn) print(df) df[\'pic\'] = binascii.hexlify(df.loc[1][\'ppicture\'])