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