I want to convert my query output to a python data frame to draw Line graph
import prestodb
import pandas as pd
conn=prestodb.dbapi.connect(
host='10.0.0.101',
port=8081,
user='hive',
catalog='hive',
schema='ong',
)
cur = conn.cursor()
query="SELECT dtime,tagName FROM machine where tagname is not null
limit 1000"
cur.execute(query)
rows = cur.fetchall()
print(rows)
df = pd.DataFrame(query, columns=['x_axis','tagName'])
This is my sample output from query
[['2018-09-08 00:00:00.000', 26], ['2018-09-08 01:00:00.000', 26],
['2018-09-08 02:00:00.000', 26], ['2018-09-08 03:00:00.000', 27],
['2018-09-08 04:00:00.000', 27], ['2018-09-08 05:00:00.000', 27]]
how to convert this query output to a data frame using python