Type and value error

hello, i am unable to solve these error,what is the right way to re-write this code or remove such error?



ema=13

dm['ema'] = dm['Close'].ewm(span=ema, adjust=False).mean()

TypeError: 'method' object is not subscriptable


print('Buy and hold returns: ',np.round(db1['cc_returns'].cumprod()[-1], 2))
ValueError: DataFrame constructor not properly called!

Hello Gaurav,



Both the lines of code look good to me. I am not able to reproduce an error in either. Please share the entire code here or maybe a screenshot of where you're running into those particular errors. 



 

THANKYOU FOR RESPONDING ACTUALLY THERE WAS A SYNTAX ERROR IN MY CODES  AND I FIGURED IT OUT LATELY.