n = Analisi.groupby('AgeT1') --------> here there are no errors
> SSbetween = (sum(Analisi.groupby('AgeT1').sum()['MeanMETList']**2)/n) - (Analisi['MeanMETList'].sum()**2) / N
You are setting variable
n
to a range of Analisi objects. In the next line you try to use that as a numerical value. Thus you get an error, you cannot divide by something that is not a number.