为什么可以从Python中导入的CSV删除列/字段?
我合并了您在另一个文件中看到的DF,当我将其导入到当前文件中时,我遇到了一个奇怪的字段,“未命名:0”,我以前从未见过。它没有回来。
我列出了列名,准确地复制了字段名称,并试图将其删除,但没有成功。
任何输入都将不胜感激。
I merged the df you see below in another file, and when I imported it into the current file, I was met with a strange field, 'Unnamed: 0', that I hadn't seen before. It wasn't there back.
I have listed the column names, copied the field name exactly, and attempted to drop it but was unsuccessful.
Any input would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试此操作时,
请始终使用Inplace = true当您更改数据框架中的某些内容或如果您不更改源dataframe,则尝试将其存储在不同的数据框架中,
Try this
Always use inplace = True when you are changing something in place in a dataframe or try to store in the different dataframe like this if you are not changing the source dataframe,
尝试以下操作:
try this :