From 47590c43b0d712bd4c1c400e7fc208c14bdaf7f9 Mon Sep 17 00:00:00 2001 From: epitaxy Date: Tue, 16 Aug 2022 01:33:20 +0000 Subject: [PATCH] First Commit --- base.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 base.py diff --git a/base.py b/base.py new file mode 100644 index 0000000..6698a5e --- /dev/null +++ b/base.py @@ -0,0 +1,10 @@ +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)) \ No newline at end of file