Error in price_returns=stock_prices.pct_change() function (QPM)

The following error is displayed on execution of this code : "TypeError: unsupported operand type(s) for /: 'str' and 'str'"

data has been imported correctly, kindly help in working around this error.

Hi Dimple



Could you point me in the direction of the notebook you are facing an error in? We would have a look at it on priority.



Till then, I think the issue is that the pct_change function is being run on some text data in the dataframe instead of numbers. If that is not the case, try doing this:

stock_prices = stock_prices.astype(float)