I have output of sqlalchemy in tuple format. Please see below output
with SQLAlchemyDBConnection() as db_conn:
response = db_conn.session.query(GroceryTbl.category,GroceryTbl.name).all()
for response in responses:
print(response)
('Fruit', 'Mango')
('Fruit', 'Banana')
('Fruit', 'Apple')
('Fruit', 'Grapes')
('Vegetable', 'Potato')
('Vegetable', 'Tomato')
('Vegetable', 'Carrot')
But I want the output in below format using pandas.
output = {'Fruit':['Mango','Banana','Apple','Grapes'],'Vegetable':['Potato','Tomato','Carrot']}