newer pandas in requirements

This commit is contained in:
avollkopf 2023-01-29 12:26:03 +01:00
parent 90f94525be
commit 679d10d4dc
3 changed files with 4 additions and 7 deletions

View file

@ -154,15 +154,12 @@ class LogController:
return data
async def get_data2(self, ids) -> dict:
def dateparse(time_in_secs):
return datetime.datetime.strptime(time_in_secs, '%Y-%m-%d %H:%M:%S')
dateparse = lambda dates: [datetime.datetime.strptime(d, '%Y-%m-%d %H:%M:%S') for d in dates]
result = dict()
for id in ids:
# df = pd.read_csv("./logs/sensor_%s.log" % id, parse_dates=True, date_parser=dateparse, index_col='DateTime', names=['DateTime',"Values"], header=None)
# concat all logs
all_filenames = glob.glob(os.path.join(self.logsFolderPath,f"sensor_{id}.log*"))
df = pd.concat([pd.read_csv(f, parse_dates=True, date_parser=dateparse, index_col='DateTime', names=['DateTime', 'Values'], header=None) for f in all_filenames])
df = pd.concat([pd.read_csv(f, parse_dates=['DateTime'], date_parser=dateparse, index_col='DateTime', names=['DateTime', 'Values'], header=None) for f in all_filenames])
df = df.resample('60s').max()
df = df.dropna()
result[id] = {"time": df.index.astype(str).tolist(), "value":df.Values.tolist()}

View file

@ -11,7 +11,7 @@ cryptography==36.0.1
requests==2.28.1
voluptuous==0.13.1
pyfiglet==0.8.post1
pandas==1.4.1
pandas==1.5.3
shortuuid==1.0.11
tabulate==0.9.0
numpy==1.24.1

View file

@ -61,7 +61,7 @@ setup(name='cbpi4',
'cbpi4gui',
'importlib_metadata',
'numpy==1.24.1',
'pandas==1.4.1'] + (
'pandas==1.5.3'] + (
['RPi.GPIO==0.7.1'] if raspberrypi else [] ),
dependency_links=[