I'm trying to create the following data structure on the fly by reading the output of another script line by line, if certain combinations of thresholds are breached, I want to track those in a dictionary:
data = {}
data[device]['mntpt'] = mntpt
data[device][timestamp] = { 'r_ops': r_ops, 'r_avgrtt': r_avgrtt, 'r_avgexe': r_avgexe, 'w_ops': w_ops, 'w_avgrtt': w_avgrtt, 'w_avgexe': w_avgexe }
For each device, there can be a varying number of timestamps, each containing 6 datapoints. The r_xxx and w_xxx variables are floats. device, mntpt and timestamp are strings.
I'm getting the following error:
TypeError: unsubscriptable object
I get the same error if I comment out this line:
# data[device]['mntpt'] = mntpt
What am I doing wrong here?
Thx