崇高的seaborn问题 [英] Issue with seaborn in sublime

查看:26
本文介绍了崇高的seaborn问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Sublime文本编辑器中遇到 seaborn 的问题.

I am having an issue with seaborn in the sublime text editor.

import pandas as pd 
import seaborn as sns

data = pd.read_csv('train.csv')
sns.factorplot('Sex', data=data)

这是错误:

Error 
File "C:\Anaconda\lib\site-packages\numpy\core\_methods.py", line 73, in _mean    
ret = ret / rcount
TypeError: unsupported operand type(s) for /: 'str' and 'long'

推荐答案

正如Arshad在评论中所说,只需在命令中添加 kind ="count" 即可解决此问题.在这种情况下,代码应如下所示.

As Arshad said in the comments, by just adding kind="count" to the command, it solves the issue. In this case, the code should look like the following.

import pandas as pd 
import seaborn as sns

data = pd.read_csv('train.csv')
sns.factorplot('Sex', data=data, kind="count")

这篇关于崇高的seaborn问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆