Error in My Project


What is the syntax error here?

@suriyasam16 All other code above and including the return statement should be inside the compute_bounds function. Please correct the indentation of your code. Your function should be as shown below

def compute_bounds(history_data,frame_size,factor):
    if len(history_data)<frame_size :
        return None

    if len(history_data)>frame_size :
        del history_data[0:len(history_data)-frame_size]
    Mn=statistics.mean(history_data)
    Variance=0
    for data in history_data :
        Variance += math.pow((data-Mn),2)
    Zn = factor * math.sqrt(Variance / frame_size)
    High_bound = history_data[frame_size-1]+Zn
    Low_bound = history_data[frame_size-1]-Zn
    return [High_bound,Low_bound]

Do let me know if you need any more help regarding your project.

@suriyasam16 Your error in your code is that u should keep all your code inside your defined function, as u defined for compute_bounds your below code should be inside that.
def compute_bounds(history_data,frame_size,factor):
if len(history_data)<frame_size :
return None

if len(history_data)>frame_size :
    del history_data[0:len(history_data)-frame_size]
Mn=statistics.mean(history_data)
Variance=0
for data in history_data :
    Variance += math.pow((data-Mn),2)
Zn = factor * math.sqrt(Variance / frame_size)
High_bound = history_data[frame_size-1]+Zn
Low_bound = history_data[frame_size-1]-Zn
return [High_bound,Low_bound]