Px.bar or other bar graph for dataframe columns as x and values as y

This is what I want to do but this example: https://plotly.com/python/bar-charts/
is a bit different.

Right now I have something like:

fig_elems = px.bar(elems_df, x=elems_df.columns.tolist(), y=elems_df.iloc[0])
        fig_vits = px.bar(vits_df, x=vits_df.columns.tolist(), y=vits_df.iloc[0])
        fig_macros = px.bar(macros_df, x=macros_df.columns.tolist(), y=macros_df.iloc[0])

where each dataframe only has one row so one value per column and I want each column to have its own bar.
But I am getting:



ValueError: All arguments should have the same length. The length of column argument `df[wide_variable_0]` is 1, whereas the length of  previously-processed arguments ['y'] is 15
Traceback (most recent call last)

    File "/home/nobu/Desktop/1_comp4911/bioactive_dash/pages/callbacks/rdi_charts_callbacks.py", line 263, in update_ingred_charts

    fig_elems = px.bar(elems_df, x=elems_df.columns.tolist(), y=elems_df.iloc[0])

    File "/home/nobu/anaconda3/envs/ecowarrior/lib/python3.8/site-packages/plotly/express/_chart_types.py", line 350, in bar

    return make_figure(

    File "/home/nobu/anaconda3/envs/ecowarrior/lib/python3.8/site-packages/plotly/express/_core.py", line 1826, in make_figure

    args = build_dataframe(args, constructor)

    File "/home/nobu/anaconda3/envs/ecowarrior/lib/python3.8/site-packages/plotly/express/_core.py", line 1358, in build_dataframe

    df_output, wide_id_vars = process_args_into_dataframe(

    File "/home/nobu/anaconda3/envs/ecowarrior/lib/python3.8/site-packages/plotly/express/_core.py", line 1166, in process_args_into_dataframe

    raise ValueError(

    ValueError: All arguments should have the same length. The length of column argument `df[wide_variable_0]` is 1, whereas the length of  previously-processed arguments ['y'] is 15

Traceback (most recent call last):
  File "/home/nobu/Desktop/1_comp4911/bioactive_dash/pages/callbacks/rdi_charts_callbacks.py", line 263, in update_ingred_charts
    fig_elems = px.bar(elems_df, x=elems_df.columns.tolist(), y=elems_df.iloc[0])
  File "/home/nobu/anaconda3/envs/ecowarrior/lib/python3.8/site-packages/plotly/express/_chart_types.py", line 350, in bar
    return make_figure(
  File "/home/nobu/anaconda3/envs/ecowarrior/lib/python3.8/site-packages/plotly/express/_core.py", line 1826, in make_figure
    args = build_dataframe(args, constructor)
  File "/home/nobu/anaconda3/envs/ecowarrior/lib/python3.8/site-packages/plotly/express/_core.py", line 1358, in build_dataframe
    df_output, wide_id_vars = process_args_into_dataframe(
  File "/home/nobu/anaconda3/envs/ecowarrior/lib/python3.8/site-packages/plotly/express/_core.py", line 1166, in process_args_into_dataframe
    raise ValueError(
ValueError: All arguments should have the same length. The length of column argument `df[wide_variable_0]` is 1, whereas the length of  previously-processed arguments ['y'] is 15

The x argument have 1 length and the y has 15.

@Eduardo, thanks for pointing that out.

I got it working with the other bar chart library.

fig_elems = go.Figure([go.Bar(x=list(elems_df.columns), y=list(elems_df.iloc[0]))])
        fig_vits = go.Figure([go.Bar(x=list(vits_df.columns), y=list(vits_df.iloc[0]))])
        fig_macros = go.Figure([go.Bar(x=list(macros_df.columns), y=list(macros_df.iloc[0]))])