Tags
python
Asked 3 years ago
11 Aug 2021
Views 359
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