Tags
python
Asked 2 years ago
11 Aug 2021
Views 287
Pearlie

Pearlie posted

TypeError: unsupported operand type(s) for -: "str" and "int"


timespan=input("Eneter days span:")
...
...
avggain = gain.ewm(com = periods - 1, adjust=True, min_periods = periods).mean()
...


i was working for dataframes and using input() function to enter the timespan and get error this below
TypeError: unsupported operand type(s) for -: 'str' and 'int'
Post Answer