Files
log-watcher/base.py
2022-08-16 01:33:20 +00:00

10 lines
335 B
Python

from operator import itemgetter
# convertion of Json Data to list
state, time = list( zip(*[ (x['state'], x['last_updated']) for x in raw_data]))
# another converion thorugh itemgetter (a little faster)
state, time = list( zip( *map(itemgetter('state', 'last_updated'), raw_data) ))
state = list(map(itemgetter('state'), raw_data))