You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MultiIndex on columns (axis1) is supported well - inputs get matched on column indexes, e.g. prices and signals frames are alligned. However, rows MultiIndex (axis0) is not working as expected: when I try to use prices and signals DataFrames with rows MultiIndex (e.g. levels “Ticker“ and „Timestamp“ instead of just „Timestamp“) I get an error: „Broadcasting index is not allowed when index_from =strict“.
It works if one sorts the DataFrames beforehand, e.g.
Would be nice if row MultiIndexes would be treated same as columns MultiIndexes - inputs alligned by row index (and broadcasted to same shape if needed).
And then, when plotting results with MultiIndex rows, would be nice to have all index levels shown hierarchically on x-axis, e.g. like this:
import plotly.graph_objs as go
fig = go.Figure()
fig.add_trace(go.Scatter(x=[df.index.get_level_values('asset'),df.index.get_level_values('DT')], y=df['fwd']))
fig.show()
Currently vbt plot produces this (Indexes collapsed into single label):
pf.value().vbt.plot()
The text was updated successfully, but these errors were encountered:
Currently, index is assumed to be time and thus sorted. But it's an interesting idea, thank you for your suggestion. I've put it to the features-wanted list.
MultiIndex on columns (axis1) is supported well - inputs get matched on column indexes, e.g. prices and signals frames are alligned. However, rows MultiIndex (axis0) is not working as expected: when I try to use prices and signals DataFrames with rows MultiIndex (e.g. levels “Ticker“ and „Timestamp“ instead of just „Timestamp“) I get an error: „Broadcasting index is not allowed when index_from =strict“.
It works if one sorts the DataFrames beforehand, e.g.
Would be nice if row MultiIndexes would be treated same as columns MultiIndexes - inputs alligned by row index (and broadcasted to same shape if needed).
And then, when plotting results with MultiIndex rows, would be nice to have all index levels shown hierarchically on x-axis, e.g. like this:
Currently vbt plot produces this (Indexes collapsed into single label):
The text was updated successfully, but these errors were encountered: