Python Pandas rolling mean DataFrame Constructor not properly called
#### Code Sample, a copy-pastable example if possible

def py_TA_MA(v, n, AscendType):  
    df = pd.DataFrame(v, columns=['Close'])
    df = df.sort_index(ascending=AscendType) # ascending/descending flag
    M = pd.Series(df['Close'].rolling(n), name = 'MovingAverage_' + str(n))
    df = df.join(M)
    df = df.sort_index(ascending=True) #need to double-check this
    return df
```
#### Problem description

I am trying to create a simple time-series, of different rolling types. One specific example, is a rolling mean of N periods using the Panda python package.

I get the following error : ValueError: DataFrame constructor not properly called!

Below is my code :