pandas 如何在熊猫中删除数据框?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/30642356/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
how to drop dataframe in pandas?
提问by Debojyoti Dey
Tips are there for dropping column and rows depending on some condition. But I want to drop the whole dataframe created in pandas. like in R : rm(dataframe) or in SQL: drop table
有根据某些条件删除列和行的提示。但我想删除在Pandas中创建的整个数据框。就像在 R 中:rm(dataframe) 或在 SQL 中:drop table
This will help to release the ram utilization.
这将有助于释放 ram 利用率。
回答by holdenweb
Generally creating a new object and binding it to a variable will allow the deletion of any object the variable previously referred to. del, mentioned in @EdChum's comment, removes both the variable and any object it referred to.
通常,创建新对象并将其绑定到变量将允许删除变量先前引用的任何对象。del,在@EdChum 的评论中提到,删除变量和它引用的任何对象。
This is an over-simplification, but it will serve.
这是一种过度简化,但它会起作用。

