我试着像这样做垂直的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)