我正在尝试用数字结尾的前一个列名来重命名我的列,以使列唯一。有办法实现这个吗?
当前数据框:
Reconnaissance Unnamed: 1 Resource Development Unnamed: 3 Initial Access Unnamed: 5
Active Scanning Scanning IP Blocks Acquire Infrastructure Botnet Drive-by Compromise NaN
期望达成:
Reconnaissance Reconnaissance_1 Resource Development Resource Development_1 Initial Access Initial Access_1
Active Scanning Scanning IP Blocks Acquire Infrastructure Botnet Drive-by Compromise NaN