How do you programmatically retrieve the number of columns in a pandas dataframe? I was hoping for something like:
df.num_columns
Alternative:
df.shape[1]
(df.shape[0] is the number of rows)
df.shape[0]