我可以用Pandas创建以下的boxplot。pandas.DataFrame.boxplot() 方法。
import pandas as pd
import numpy as np
np.random.seed(1234)
df = pd.DataFrame(np.random.rand(10, 4),
columns=['Col1', 'Col2', 'Col3', 'Col4'])
df.plot.box()
plt.show()
不过,如果我尝试用HoloViews的方法来做同样的事情的话 盒须元素 以Bokeh为后台,单列工作正常。
import holoviews as hv
from holoviews import opts
hv.extension('bokeh')
hv.BoxWhisker(
data=df['Col1'],
vdims='Col1'
)
但当我尝试添加另一列时,我得到了下面的错误。
hv.BoxWhisker(
data=df[['Col1', 'Col2']]
)
DataError: None of the available storage backends were able to support the supplied data format. PandasInterface raised following error:
unsupported operand type(s) for +: 'NoneType' and 'int'
PandasInterface expects tabular data, for more information on supported datatypes see http://holoviews.org/user_guide/Tabular_Datasets.html
我不明白是否有什么问题 表格数据 HoloViews理解,或者说我无法正确应用语法轴。