I'm doing an API call and getting the below output. But what I'm actually looking for is only the lowest value for 'Active Tunnels' to be displayed. I know "for" loop is the answer but I've tried so many things in the past 5 hours and got no where close to my goal. Please help me.
{u'histdata': [{u'Active Tunnels': 378.0,
u'Utilization': 2.0,
u'coverage': u'100 %',
u'datetime': u'22/11/2021 16:00:49'},
{u'Active Tunnels': 377.0,
u'Utilization': 2.0,
u'coverage': u'100 %',
u'datetime': u'22/11/2021 16:01:49'},
{u'Active Tunnels': 376.0,
u'Utilization': 2.0,
u'coverage': u'100 %',
u'datetime': u'22/11/2021 16:02:49'},
{u'Active Tunnels': 374.0,
u'Utilization': 2.0,
u'coverage': u'100 %',
u'datetime': u'22/11/2021 16:03:49'}]
You can try this, FYI it's not the optimal solution but i think it will solve the issue ,
uis for Unicode This will give you the dict having lowest value forActive Tunnels, you can easily get the value for that key[{'Active Tunnels': 374.0, 'Utilization': 2.0, 'coverage': '100 %', 'datetime': '22/11/2021 16:03:49'}]And you are missing
}at end in your data