已关闭,此问题需要更focused。它目前不接受回答。
**想改善这个问题吗?**更新问题,使其只关注editing this post的一个问题。
上个月关门了。
Improve this question
所以我试图编辑一个CSV文件(使用Pandas),作为Python的初学者,我正在努力制定如何做到这一点。
这些列称为“文件大小”,条目如下:1.0 MB 2.10 MB 12 GB 1.2 GB
我想把它转换成数字,这样我就可以根据实际大小进行比较和过滤。有人知道该怎么做吗?
我在谷歌上搜索过,但实际上并没有尝试打出任何东西,因为我完全不知道如何做到这一点。我正在寻找课程,所以如果你有任何,请让我知道!
1条答案
按热度按时间zour9fqk1#
这是你的解决方案。我用一个示例
csv
文件测试了这个问题,如下所示:下面是如何将
sizes in string
列转换为数字:输出量: