How to retrieve the data from the database using pyodbc and sql server with python

I have a python code that connect with sql server and retrieve the required data based on select query and display the result as a table with columns and rows.

The problem is that the retrieved data is displayed without columns name as shown in the picture below.

enter image description here


import pandas as pd
import streamlit as st

st_input_update = st.number_input if is_numeric_dtype(all_columns) else st.text_input
search_term=st_input_update("Enter Search Term")
sql='select * from testDB.dbo.t1 where last LIKE  ? '
rows = cursor.execute(sql, param).fetchall()