How do you programmatically retrieve the number of columns in a pandas dataframe? I was hoping for something like:
df.num_columns
This worked for me len(list(df)).