I have been trying to calculate Stocastic RSI on multi-index dataframe by using "groupby" symbol, and then calling inline function. Following is the code:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\jafre\AppData\Local\Programs\Python\Python36\lib\site-packages\pandas\core\frame.py", line 2519, in __setitem__
self._set_item(key, value)
File "C:\Users\jafre\AppData\Local\Programs\Python\Python36\lib\site-packages\pandas\core\frame.py", line 2585, in _set_item
value = self._sanitize_column(key, value)
File "C:\Users\jafre\AppData\Local\Programs\Python\Python36\lib\site-packages\pandas\core\frame.py", line 2760, in _sanitize_column
value = _sanitize_index(value, self.index, copy=False)
File "C:\Users\jafre\AppData\Local\Programs\Python\Python36\lib\site-packages\pandas\core\series.py", line 3121, in _sanitize_index
raise ValueError('Length of values does not match length of ' 'index')
ValueError: Length of values does not match length of index
Can someone help with the changes in the code so that multiple output columns can be created in this multi-index dataframe?
I have been trying to calculate Stocastic RSI on multi-index dataframe by using "groupby" symbol, and then calling inline function. Following is the code:
The error is:
Can someone help with the changes in the code so that multiple output columns can be created in this multi-index dataframe?