Replies: 3 comments 1 reply
-
|
I also got this error when attempting to do this. |
Beta Was this translation helpful? Give feedback.
-
|
As the error message says there is a problem with column names that do not have a common part (do not overlap). If you see the columns of >>> rsi.columns
MultiIndex([(12, 'Close')],
names=['rsi_window', None])
>>> close.columns
Index(['Close'], dtype='object')You can modify close.columns = pd.MultiIndex.from_tuples([(rsi_window, 'Close')], names=['rsi_window', None])Not sure if it is the best solution but for your case should be sufficient. It might fail when using vector of parameters (e.g. |
Beta Was this translation helpful? Give feedback.
-
|
You can just add axis=0 and it will works. You can learn more at the documentation: https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.align.html |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
My goal:
I have two time-series data frames, one with a time interval of 1m and the other with a time interval of 5m. The 5m data frame is a resampled version of the 1m data. What I'm doing is computing a set of RSI values that correspond to the 5m df using the vectorbt library, then aligning and broadcasting these values to the 1m df using df.align
The Problem:
When trying to do this line by line, it works perfectly. Here's what the final result looks like:
Working result(expected)
However, when applying it under the function, it returns the following error while having overlapping index names:
ValueError: cannot join with no overlapping index namesHere's the complete code:
Any help would be appreciated. Thankyou!
Beta Was this translation helpful? Give feedback.
All reactions