Invalid 'figure_or_data' argument when plotting a chart with traces appended through loops - plotly
<p>I put together a code that can be inserted into a loop, in order to plot a line chart, appending a trace for the values of each column in a dataframe.
I have been struggling with this for a while, and I cannot quite figure out how keys in plotly figures and layout objects should be called.</p>

<pre><code>import pandas as pd
import plotly.plotly as py
from plotly import tools, utils
from plotly.graph_objs import *


d = {'one' : pd.Series([1, 2, 3], index=['a', 'b', 'c']),
'two' : pd.Series([1, 2, 3, 4], index=['a', 'b', 'c', 'd']),
'three' : pd.Series([1, 2, 3, 4, 5], index=['a', 'b', 'c', 'd','e'])}
df = pd.DataFrame(d)

print(df.head())

data = []

for column in df:

    trace = Scatter(
    x = df.index, 
    y = df[column],
    mode = 'lines',
    line = Line(
        color='#FFD700',
        width=1
        ),
    name = column
    )
    data.append([trace])


layout = dict(
    title= 'Room Ambient Temperatures (with range slider and selectors)',

    yaxis=dict(
        range=[20,30],
        showgrid=True,
        zeroline=True,
        showline=False,
    ),

)
fig = dict(data=data, layout=layout)    #fig = Figure(data=data, layout=layout)    

chart_url = py.plot(fig, filename = 'test/_T_Line_Chart', auto_open=False)
</code></pre>

<p>Error I get is:</p>

<pre><code>Invalid entry found in 'data' at index, '0'
Path To Error: ['data'][0]
Valid items for 'data' at path ['data'] under parents ['figure']:
    ['Contour', 'Box', 'Scatter3d', 'Bar', 'Mesh3d', 'Histogram', 'Surface',
    'Pie', 'Histogram2d', 'Scattergeo', 'Scattergl', 'Scattermapbox',
    'Scatterternary', 'Candlestick', 'Ohlc', 'Scatter', 'Area',
    'Histogram2dcontour', 'Choropleth', 'Heatmap', 'Pointcloud']
Entry should subclass dict.
</code></pre>

<p>Any idea why?</p>