值以' b&#x27开头。将ARFF文件读取到Pandas DataFrame时

发布于 2025-02-11 15:38:08 字数 520 浏览 1 评论 0 原文

我正在阅读这个arff noreferrer”> pandas dataframe in Colab。我使用了以下代码,这似乎是相当标准的,从最佳搜索结果的快速扫描告诉我。

from scipy.io.arff import loadarff 

raw_data = loadarff('/speeddating.arff')
df = pd.DataFrame(raw_data[0])

当我检查数据框时,许多值以这种格式出现: b'Some_text'

当我调用 type(df.iloc [0,0])时,它返回 bytes

发生了什么,我该怎么做不这样?

I'm reading in this arff file to a pandas dataframe in Colab. I've used the following code, which seems to be fairly standard, from what a quick scan of top search results tells me.

from scipy.io.arff import loadarff 

raw_data = loadarff('/speeddating.arff')
df = pd.DataFrame(raw_data[0])

When I inspect the dataframe, many of the values appear in this format: b'some_text'.

When I call type(df.iloc[0,0]) it returns bytes.

What is happening, and how do I get it to not be that way?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

飘落散花 2025-02-18 15:38:08

如果其他人偶然发现了这个问题,我发现它在这里回答:当Arff加载到Python时,字母出现在数据中

If anyone else stumbles upon this question, I found it answered here: Letter appeared in data when arff loaded into Python

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文