# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

from gpcharts import figure
import json
from dateutil import parser

# +
# my_plot = figure(title='Demo')
# my_plot.plot([1, 2, 10, 15, 12, 23])
# -

# ls -al

with open('data.json') as dataFile:    
    jsonData = json.load(dataFile)

dt = parser.parse(jsonData["cc45108d4bf137346761df0d022f1383"]["time"])
jsonData["cc45108d4bf137346761df0d022f1383"]["time"]

dt.hour

timeSlice = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

counter = 0
for key in jsonData:
    userKey = jsonData[key]["userKey"]
    if userKey != "encryptedUserKey" and userKey != "" and userKey != "<KEY>":
        dt = parser.parse(jsonData[key]["time"])
        hour = (dt.hour + 9) % 24
        timeSlice[hour] += 1
        counter += 1
timeSlice

my_plot = figure(title='Demo')
my_plot.plot(timeSlice)



StarcoderdataJupyterScriptsDedupFiltered