Complete the code to initialize the trend chart data array.
trendData = [[1] for _ in range(100)]
The trend chart data array should start with zeros to represent initial values.
Complete the code to add a new process variable value to the trend chart buffer.
trendData.append([1]) if len(trendData) > 100: trendData.pop(0)
We append the current process variable value stored in processValue to the trend data.
Fix the error in the code that calculates the average value for the trend chart.
average = sum(trendData) / [1](trendData)
The len() function returns the number of items in the list, which is needed to calculate the average.
Fill both blanks to filter trend data for values above a threshold and square them.
filteredTrend = [x[1]2 for x in trendData if x [2] 50]
We square each value using **2 and filter values greater than 50 using >.
Fill all three blanks to create a dictionary of time stamps and values filtered by a minimum value.
trendDict = { [1]: [2] for [3], [2] in zip(timeStamps, trendData) if [2] >= 10 }The dictionary comprehension uses t as the key (time stamp), v as the value, and iterates over t, v pairs from zip(timeStamps, trendData).
