简体   繁体   中英

Remove repeating column values in Python Pandas

I have a data set that has dates and subtotal of other columns. 在此处输入图片说明

I want to remove the same recurring dates per subtotal

在此处输入图片说明

您可以使用其现有列的帮助下简单地将当前数据帧的指数DataFrame.set_index

df.set_index(['w/c Mon', 'Portfolio'])

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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