title: Plotly: How to make a line plot from a pandas dataframe with a long or wide format?
body: <p><em>(This is a self-answered post to help others shorten their answers to plotly questions by not having to explain how plotly best handles data of long and wide format)</em></p>
  
  <hr>
  
  <p>I'd like to build a plotly figure based on a pandas dataframe in as few lines as possible. I know you can do that using plotly.express, but this fails for what I would call a standard pandas dataframe; an index describing row order, and column names describing the names of a value in a dataframe:</p>
  
  <h3>Sample dataframe:</h3>
  
  <pre><code>    a           b           c
  0   100.000000  100.000000  100.000000
  1   98.493705   99.421400   101.651437
  2   96.067026   98.992487   102.917373
  3   95.200286   98.313601   102.822664
  4   96.691675   97.674699   102.378682
  </code></pre>
  
  <h3>An attempt:</h3>
  
  <pre><code>fig=px.line(x=df.index, y = df.columns)
  </code></pre>
  
  <p>This raises an error:</p>
  
  <blockquote>
    <p>ValueError: All arguments should have the same length. The length of argument <code>y</code> is 3, whereas the length of previous arguments ['x'] is 100`</p>
  </blockquote>