标签: python-3.x dataframe
我想在熊猫中创建一个新列,如果标题列与前一行相同,则顺序是递增的。如果标题不同,重新开始计数。
我该怎么做?
original_df title music music theatre theatre theatre update_df order title 1 music 2 music 1 theatre 2 theatre 3 theatre