2
I have the following function that I have done which is this :
def funcao(elemento):
    x = []
    for i in grafico:
            timestring = i["CrimeTime"]
            x.append(timestring)
    x= sorted(x)
    y= Counter(x).values()
    return x,y
And what you give me is :
(['16:40:00', '16:45:00', '17:30:00', '18:30:00', '18:38:00', '20:00:00', '21:30:00', '21:30:00', '21:51:00'], [1, 1, 2, 1, 1, 1, 1, 1])
Being what you should give me is :
Código :
(['16:40:00', '16:45:00', '17:30:00', '18:30:00', '18:30:00', '20:00:00', '21:30:00', '21:30:00', '21:51:00'], [1, 1, 1, 2 , 1,2, 1])
The goal is to get the ordered hours that gives correct ,and the number of times each hour repeats , and the values are well , are not correctly positioned( may have to do with the fact to fetch the values to dictionary) but I don’t see how I get the correctly ordered values