how to delete a duplicate column read from excel in pandas
问题 Data in excel: a b a d 1 2 3 4 2 3 4 5 3 4 5 6 4 5 6 7 Code: df= pd.io.excel.read_excel(r"sample.xlsx",sheetname="Sheet1") df a b a.1 d 0 1 2 3 4 1 2 3 4 5 2 3 4 5 6 3 4 5 6 7 how to delete the column a.1 ? when pandas reads the data from excel it automatically changes the column name of 2nd a to a.1. I tried df.drop("a.1",index=1) , this does not work. I have a huge excel file which has duplicate names, and i am interested only in few of columns. 回答1: If you know the name of the column you