相关疑难解决方法(0)

Seaborn boxplot:TypeError:/:'str'和'int'不支持的操作数类型

我试着像这样做垂直的seaborn boxplot

import pandas as pd
df = pd.DataFrame({'a' : ['a', 'b' , 'b', 'a'], 'b' : [5, 6, 4, 3] })
import seaborn as sns
import matplotlib.pylab as plt
%matplotlib inline
sns.boxplot(  x= "b",y="a",data=df )
Run Code Online (Sandbox Code Playgroud)

我明白了

在此输入图像描述

我写东方

sns.boxplot(  x= "c",y="a",data=df , orient = "v")
Run Code Online (Sandbox Code Playgroud)

得到

TypeError: unsupported operand type(s) for /: 'str' and 'int'
Run Code Online (Sandbox Code Playgroud)

sns.boxplot(  x= "c",y="a",data=df , orient = "h")
Run Code Online (Sandbox Code Playgroud)

工作coreect!怎么了?

TypeError                                 Traceback (most recent call last)
<ipython-input-16-5291a1613328> in <module>()
----> 1 sns.boxplot(  x= "b",y="a",data=df , orient …
Run Code Online (Sandbox Code Playgroud)

python seaborn

5
推荐指数
1
解决办法
6558
查看次数

标签 统计

python ×1

seaborn ×1