a = {}
for dev in all_data:
for data in all_data[dev]:
if int(data['dev_unix_time']) <= int(period[1]):
a[dev] = {
data['dev_time_year'] : {
data['dev_time_month'] : {
data['dev_time_day'] : {
data['dev_time_hour'] : {
'dev_value' : data['dev_value'],
'dev_tariff1': data['dev_tariff1'],
'dev_tariff2' : data['dev_tariff2'],
'dev_tariff3' : data['dev_tariff3'],
'dev_tariff4' : data['dev_tariff4'],
'dev_unix_time' : data['dev_unix_time'],
'dev_time_year' : data['dev_time_year'],
'dev_time_month' : data['dev_time_month'],
'dev_time_year_month' : data['dev_time_year_month'],
'dev_time_day' : data['dev_time_day'],
'dev_time_hour' : data['dev_time_hour'],
'dev_serial' : data['dev_serial'],
'dev_package_id' : data['dev_package_id'],
'dev_uuid' : data['dev_uuid']
}
}
}
}
}
arr[a]['2022']['09']['01']['21'] = значение1
arr[a]['2022']['09']['01']['22'] = значение2
arr[a]['2022']['09']['02']['21'] = значение3
arr[a]['2022']['09']['02']['22'] = значение4
r[dev][0][0]
<memory at 0x0000012ED1BF9400>