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
I use enums as keys to my dataframe and plotly is able to plot if I pass a single column to plotly like y=Column.Impedance. However, when I pass it a list of columns, it shows the following error:
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
[/home/subaru/projects/oral-cancer/analysis-v2/main.ipynb](https://file+.vscode-resource.vscode-cdn.net/home/subaru/projects/oral-cancer/analysis-v2/main.ipynb) Cell 12 line 3
[22](vscode-notebook-cell:/home/subaru/projects/oral-cancer/analysis-v2/main.ipynb#X43sZmlsZQ%3D%3D?line=21) df = pd.DataFrame(
[23](vscode-notebook-cell:/home/subaru/projects/oral-cancer/analysis-v2/main.ipynb#X43sZmlsZQ%3D%3D?line=22) {
[24](vscode-notebook-cell:/home/subaru/projects/oral-cancer/analysis-v2/main.ipynb#X43sZmlsZQ%3D%3D?line=23) Column.Frequency: range(10),
(...)
[27](vscode-notebook-cell:/home/subaru/projects/oral-cancer/analysis-v2/main.ipynb#X43sZmlsZQ%3D%3D?line=26) }
[28](vscode-notebook-cell:/home/subaru/projects/oral-cancer/analysis-v2/main.ipynb#X43sZmlsZQ%3D%3D?line=27) )
[29](vscode-notebook-cell:/home/subaru/projects/oral-cancer/analysis-v2/main.ipynb#X43sZmlsZQ%3D%3D?line=28) display(df)
---> [30](vscode-notebook-cell:/home/subaru/projects/oral-cancer/analysis-v2/main.ipynb#X43sZmlsZQ%3D%3D?line=29) px.line(df, x=Column.Frequency, y=[Column.Voltage, Column.Impedance]).show()
File [~/projects/oral-cancer/analysis-v2/.venv/lib/python3.11/site-packages/plotly/express/_chart_types.py:264](https://file+.vscode-resource.vscode-cdn.net/home/subaru/projects/oral-cancer/analysis-v2/~/projects/oral-cancer/analysis-v2/.venv/lib/python3.11/site-packages/plotly/express/_chart_types.py:264), in line(data_frame, x, y, line_group, color, line_dash, symbol, hover_name, hover_data, custom_data, text, facet_row, facet_col, facet_col_wrap, facet_row_spacing, facet_col_spacing, error_x, error_x_minus, error_y, error_y_minus, animation_frame, animation_group, category_orders, labels, orientation, color_discrete_sequence, color_discrete_map, line_dash_sequence, line_dash_map, symbol_sequence, symbol_map, markers, log_x, log_y, range_x, range_y, line_shape, render_mode, title, template, width, height)
216 def line(
217 data_frame=None,
218 x=None,
(...)
258 height=None,
259 ) -> go.Figure:
260 """
261 In a 2D line plot, each row of `data_frame` is represented as vertex of
262 a polyline mark in 2D space.
263 """
--> 264 return make_figure(args=locals(), constructor=go.Scatter)
...
1255 )
1256 df_output[str(col_name)] = to_unindexed_series(argument, str(col_name))
1258 # Finally, update argument with column name now that column exists
ValueError: All arguments should have the same length. The length of argument `y` is 2, whereas the length of previously-processed arguments ['Frequency'] is 10
Please let me know how this could be addressed.
The text was updated successfully, but these errors were encountered:
I have a project which has a snippet like this:
I use enums as keys to my dataframe and plotly is able to plot if I pass a single column to plotly like
y=Column.Impedance
. However, when I pass it a list of columns, it shows the following error:Please let me know how this could be addressed.
The text was updated successfully, but these errors were encountered: