简体   繁体   English

如何从python pandas数据框中删除单元格

[英]How to delete the cell from python pandas dataframe

I want to delete the dataframe index value specific like in 11th row 80 value using python dataframe pandas.我想删除特定于第 11 行 80 值的数据帧索引值,使用 python 数据帧熊猫。 I want to delete the value at the 11th row column no.我想删除第 11 行列号的值。 of clients 86. I want to delete specific 86 only not row or column using python. 86 个客户端。我只想删除特定的 86 个,而不是使用 python 删除行或列。

截屏

If 'delete' means 'set to zero', then you can set the value in column 'No_Of_Clients' of row with index 11 by如果“删除”表示“设置为零”,则您可以通过以下方式设置索引为 11 的行的“No_Of_Clients”列中的值

df.at[11, 'No_Of_Clients'] = 0

Alternatively, you can also set it to None or np.nan depending on your needs.或者,您也可以根据需要将其设置为Nonenp.nan

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM