我正在尝试用我的数据制作水平直方图,但出现此错误:
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
Run Code Online (Sandbox Code Playgroud)
当我使用时,我总是得到一个漂亮的直方图
px.histogram(df, x="columnName")
Run Code Online (Sandbox Code Playgroud)
但当我尝试将其更改为水平时,它不起作用。
px.histogram(df, y="columnName") or px.histogram(df, x="columnName", orientation='h') don't work.
Run Code Online (Sandbox Code Playgroud)
我没有 NoneType 的数据,我什至尝试过,px.histogram(y=np.random.randn(500))但它仍然不起作用。
我尝试使用go.Figure(data=[go.Histogram(y=df['columnName'])])它确实给了我一个水平历史记录,但随后我无法根据不同的列更改颜色。
任何帮助将不胜感激,提前致谢:)