Skip to content

ValueError: Plotly Express cannot process wide-form data with columns of different type. #4219

Description

@ashparkEGS

ValueError Traceback (most recent call last)
Cell In [22], line 222, in Window.on_clickPr2(self)
220 self.setWindowIcon(QtGui.QIcon('_Setup\logoWorking.png'))
221 SetGlobalVariables()
--> 222 PrPart2(self)
224 self.setWindowIcon(QtGui.QIcon('_Setup\egsaustralia.ico'))
225 self.setWindowTitle(str('Processing Part 2 - Finished'))

Cell In [21], line 1005, in PrPart2(self)
1000 figTIDEPPK.show()
1004 if PPPFTPData :
-> 1005 figPPKVsON = px.scatter(dfPPP_PPK, x=dfPPP_PPK.index, y=['ONSHORE','PPK','PPP'], title='Chart: Comparison of PPP, PPK and ONSHORE GNSS Tide'+GTE,width=1000, height=600)
1006 else:
1007 figPPKVsON = px.scatter(dfPPP_PPK, x=dfPPP_PPK.index, y=['ONSHORE','PPK'], title='Chart: Comparison of PPK and ONSHORE GNSS Tide'+GTE,width=1000, height=600)

File ~\Miniconda3\lib\site-packages\plotly\express_chart_types.py:66, in scatter(data_frame, x, y, color, symbol, size, 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, color_continuous_scale, range_color, color_continuous_midpoint, symbol_sequence, symbol_map, opacity, size_max, marginal_x, marginal_y, trendline, trendline_options, trendline_color_override, trendline_scope, log_x, log_y, range_x, range_y, render_mode, title, template, width, height)
12 def scatter(
13 data_frame=None,
14 x=None,
(...)
60 height=None,
61 ) -> go.Figure:
62 """
63 In a scatter plot, each row of data_frame is represented by a symbol
64 mark in 2D space.
65 """
---> 66 return make_figure(args=locals(), constructor=go.Scatter)

File ~\Miniconda3\lib\site-packages\plotly\express_core.py:1948, in make_figure(args, constructor, trace_patch, layout_patch)
1945 layout_patch = layout_patch or {}
1946 apply_default_cascade(args)
-> 1948 args = build_dataframe(args, constructor)
1949 if constructor in [go.Treemap, go.Sunburst, go.Icicle] and args["path"] is not None:
1950 args = process_dataframe_hierarchy(args)

File ~\Miniconda3\lib\site-packages\plotly\express_core.py:1452, in build_dataframe(args, constructor)
1450 dtype = v_dtype
1451 elif dtype != v_dtype:
-> 1452 raise ValueError(
1453 "Plotly Express cannot process wide-form data with columns of different type."
1454 )
1455 df_output = df_output.melt(
1456 id_vars=wide_id_vars,
1457 value_vars=wide_value_vars,
1458 var_name=var_name,
1459 value_name=value_name,
1460 )
1461 assert len(df_output.columns) == len(set(df_output.columns)), (
1462 "Wide-mode name-inference failure, likely due to a internal bug. "
1463 "Please report this to "
1464 "https://github.com/plotly/plotly.py/issues/new and we will try to "
1465 "replicate and fix it."
1466 )

ValueError: Plotly Express cannot process wide-form data with columns of different type.

Activity

  1. self-assigned this
    on Jul 11, 2024
  2. removed their assignment
    on Aug 2, 2024
  3. emilykl commented on Sep 1, 2026

    @emilykl
    Contributor

    Same issue as #3394

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3backlogbugsomething broken

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions