Normally, I am able to use plotly library for visualization. However, the problem emerges when I try the same visualization inside a loop (or a function) like this:
for df in all_pages_df:
trace = go.Scatter(
x = df['created_at'],
y = df['count'],
mode = 'markers'
)
data = [trace]
py.iplot(data, filename='basic-scatter')
The code above, prints nothing. When I use
print py.iplot(data, filename='basic-scatter')
Then all I see is
<plotly.tools.PlotlyDisplay object>
as the output.
I did my search but could not see a solution to this problem. Any ideas?