how to count the number of 1 in a column in python using panda code example
Example 1: number of column in dataset pandas
len(df.columns)
Example 2: python count variable and put the count in a column of data frame
df['freq'] = df.groupby('myvar')['myvar'].transform('count')