PV Monitoring - Pecos
Verfasst: Dienstag 6. September 2022, 08:28
Hallo zusammen,
dein dem erstellen eines PV Monitorings stoße ich auf das Problem: AssertionError: data.index must be a DatetimeIndex in Zeile 60 pm.add_dataframe(values)
Sobald ich dier Vaiaablen Values & History in einen DatetimeIndex wandle
#values = pd.to_datetime((values.index))
#history = pd.to_datetime((history.index))
bekomme ich den Fahler AssertionError: data must be of type pd.DataFrame in Zeile 60 pm.add_dataframe(values)
Die Datenbasis ist Folgende: https://github.com/sandialabs/pecos/blo ... _11_11.dat
Ich komme leider nicht mehr weiter und hoffe Ihr kennt eine Lösung.
[code
import pandas as pd
import numpy as np
import datetime
import loggin
# Create the SQLite engine
# db_uri = environ.get('SQLALCHEMY_DATABASE_URI')
# engine = create_engine(db_uri, echo=False)
# df = pd.read_csv("Datenbasis")
# df.to_sql("Testdaten_WR", engine)
# Load data and recent history from the database
today = datetime.date.today()
print(today)
history = today -datetime.timedelta(days=1)
data = pd.read_csv("Datenbasis")
df = pd.DataFrame(data)
pd.to_datetime(df['TIMESTAMP'])
df.index = pd.DataFrame(df['TIMESTAMP'])
values = pd.date_range(start=today, end=today, freq='1MIN')
values=pd.DataFrame(values)
history = pd.date_range(start=history, end=history , freq='1MIN')
history=pd.DataFrame(history)
# Setup the PerformanceMonitoring with data and history and run a streaming outlier test
pm = pecos.monitoring.PerformanceMonitoring()
print(history)
print(values)
pm.add_dataframe(values)
pm.add_dataframe(history)
pm.check_outlier([-3, 3], window=3600, streaming=True)
# Save the cleaned data and test results to the database
pm.cleaned_data.to_sql('qc_data', if_exists='append')
pm.test_results.to_sql('qc_summary', if_exists='append')[/code]
Vielen Dank im Voraus!
Beste grüße
Lionel
dein dem erstellen eines PV Monitorings stoße ich auf das Problem: AssertionError: data.index must be a DatetimeIndex in Zeile 60 pm.add_dataframe(values)
Sobald ich dier Vaiaablen Values & History in einen DatetimeIndex wandle
#values = pd.to_datetime((values.index))
#history = pd.to_datetime((history.index))
bekomme ich den Fahler AssertionError: data must be of type pd.DataFrame in Zeile 60 pm.add_dataframe(values)
Die Datenbasis ist Folgende: https://github.com/sandialabs/pecos/blo ... _11_11.dat
Ich komme leider nicht mehr weiter und hoffe Ihr kennt eine Lösung.
[code
import pandas as pd
import numpy as np
import datetime
import loggin
# Create the SQLite engine
# db_uri = environ.get('SQLALCHEMY_DATABASE_URI')
# engine = create_engine(db_uri, echo=False)
# df = pd.read_csv("Datenbasis")
# df.to_sql("Testdaten_WR", engine)
# Load data and recent history from the database
today = datetime.date.today()
print(today)
history = today -datetime.timedelta(days=1)
data = pd.read_csv("Datenbasis")
df = pd.DataFrame(data)
pd.to_datetime(df['TIMESTAMP'])
df.index = pd.DataFrame(df['TIMESTAMP'])
values = pd.date_range(start=today, end=today, freq='1MIN')
values=pd.DataFrame(values)
history = pd.date_range(start=history, end=history , freq='1MIN')
history=pd.DataFrame(history)
# Setup the PerformanceMonitoring with data and history and run a streaming outlier test
pm = pecos.monitoring.PerformanceMonitoring()
print(history)
print(values)
pm.add_dataframe(values)
pm.add_dataframe(history)
pm.check_outlier([-3, 3], window=3600, streaming=True)
# Save the cleaned data and test results to the database
pm.cleaned_data.to_sql('qc_data', if_exists='append')
pm.test_results.to_sql('qc_summary', if_exists='append')[/code]
Vielen Dank im Voraus!
Beste grüße
Lionel