我正在使用jupyter笔记本来可视化简单的熊猫数据框。
这是我的代码:
import pandas as pd
import numpy as np
%matplotlib inline
import cufflinks as cf
from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot
init_notebook_mode(connected=True)
cf.go_offline()
df = pd.DataFrame(np.random.randn(100,4),columns='A B C D'.split())
df.iplot()
但是当我运行代码时,发生以下异常:
AttributeError Traceback (most recent call last)
<ipython-input-28-69813823c9f3> in <module>()
----> 1 df.iplot()
16 frames
/usr/local/lib/python3.6/dist-packages/plotly/graph_objs/layout/mapbox/__init__.py in __init__(self, arg, below, circle, color, coordinates, fill, line, maxzoom, minzoom, name, opacity, source, sourceattribution, sourcelayer, sourcetype, symbol, templateitemname, type, visible, **kwargs)
797 in the interval [0, 9223372036854775807]
798
--> 799 Returns
800 -------
801 int
AttributeError: module 'plotly.validators.layout.mapbox.layer' has no attribute 'CoordinatesValidator'
熊猫版本:“ 0.24.2”
numpy版本:“ 1.16.5”
袖扣版本:“ 0.16”
全面发布版本“ 4.1.1”