I am trying to use cufflinks to plot some charts on jupyter notebook. However, this method doesn’t seem to work. An error “AttributeError: ‘Layout’ object has no attribute ‘get’” shows up. Any ideas?
df.iplot(layout=layout, x=‘x’, y=‘y’, kind=‘bar’)
Try updating your cufflinks to the latest version. Support for plotly.py version 3 was added relatively recently.
Hope that helps! And if not, please include the versions of plotly.py and cufflinks that you have installed.
My cf version is 0.14.5. Plotly.py version is 3.3.0.
It looks like support for plotly.py version 3 was added in cufflinks 0.14, so your version should be new enough. In that case, I recommend opening a bug report with the cufflinks project at https://github.com/santosjorge/cufflinks/issues.
Perhaps cufflinks doesn’t handle passing a plotly.py
graph_objs.Layout object into
iplot. You could try converting it into a
df.iplot(layout=layout.to_plotly_json(), x='x', y='y', kind='bar')
Converting it to a dict first works. Thank you!