从熊猫中的dataframe中删除\ xa0

发布于 2025-02-02 22:17:51 字数 445 浏览 3 评论 0原文

我有一个NBA球队名称的列表,这些名称已加倍。如何使用\ xa0删除条目?

这是我得到的输出。

['Atlanta Hawks', 'Atlanta Hawks\xa0', 'Boston Celtics', 'Boston Celtics\xa0', ect

从网络捕捉过程中删除种子?

teams["Team"] = teams["Team"].str.replace("(1)", "", regex=False)
teams["Team"] = teams["Team"].str.replace("(2)", "", regex=False)

teams["Team"] = teams["Team"].str.replace("(15)", "", regex=False)

我正在通过如何将列表列出\ XA0条目来删除

I have a list of NBA team names that have doubled up. How do I remove the entries with \xa0?

This is the output I get.

['Atlanta Hawks', 'Atlanta Hawks\xa0', 'Boston Celtics', 'Boston Celtics\xa0', ect

I am removing the seed from the webscraping process by

teams["Team"] = teams["Team"].str.replace("(1)", "", regex=False)
teams["Team"] = teams["Team"].str.replace("(2)", "", regex=False)

teams["Team"] = teams["Team"].str.replace("(15)", "", regex=False)

How to I get my list to not include the \xa0 entries?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文