O'Reilly logo
  • crh92 thinks this is interesting:

df[list(df.columns)[:-1]]

From

Cover of Mastering Machine Learning with scikit-learn - Second Edition

Note

more clearly done as

df.iloc[:, :-1]