我正在尝试通过访问 SQLite 数据库来绘制时间序列数据。我通过编写以下脚本成功连接了数据库,但是,我不知道如何从.sqlite文件中绘制时间序列数据。
import sqlite3
from sqlite3 import Error
def create_connection(db_file):
""" create a database connection to the SQLite database
specified by the db_file
:param db_file: database file
:return: Connection object or None
"""
conn = None
try:
conn = sqlite3.connect(db_file)
except Error as e:
print(e)
return conn
def main():
database = r"E:\Data\SINCAL_Models\AusNetData\20180128_PQV\pq.sqlite"
# create a database connection
conn = create_connection(database)
with conn:
print("Database connected:")
if __name__ == '__main__':
main()
数据库文件如附图所示。我正在尝试绘制黄色突出显示的变量以获得像这里这样的情节
