pandas returning the unnamed columns
问题 The following is example of data I have in excel sheet. A B C 1 2 3 4 5 6 I am trying to get the columns name using the following code: p1 = list(df1t.columns.values) the output is like this [A, B, C, 'Unnamed: 3', 'unnamed 4', 'unnamed 5', .....] I checked the excel sheet, there is only three columns named A, B, and C. Other columns are blank. Any suggestion? 回答1: There is problem some cells are not empty but contains some whitespaces. If need columns names with filtering Unnamed : cols =