Column names for SQL-df extracted.
I am able to retrieve the data from DB with below code, but its column names is of the digits from 0 onwards. How do I automatically retrieve its original column names?
import numpy as np
import pandas as pd
conn = psycopg2.connect(database="DBname", user="username", password="password***", host="12.12.345.678", port="5432")
cursor = conn.cursor()
cursor.execute("SELECT * from daily_consumption order by date_consumption desc limit 1000")
consumption_df = pd.DataFrame(rows)
See output here: https://imgur.com/Mqwt0A1