select all column except the last one pandas code example Example: how to select all but last columns in python df.iloc[:,:-1]