Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我最近了解到可以使用该iloc功能删除数据框对象的列和行(如本教程中所述);例如,要删除我们可以编写的数据帧的第 0 行df = df.iloc[1: , :]。
iloc
df = df.iloc[1: , :]
在工作中,我经常需要按索引删除列或行,因此该iloc函数似乎比 Pandas 的预打包函数更易于使用drop。但是,使用第一种方法有什么缺点吗?
drop