number of columns dataframe python code example Example: number of column in dataset pandas len(df.columns)