I have a column with bits in a Spark Dataframe df. The columns are strings of format:
10001010000000100000000000000000
10001010000000100000000100000000
Is there a simple and effective way to create a new column "no_of_ones" and count the frequency of ones using a Dataframe? Using RDDs I can map(lambda x:x.count('1')) (pyspark).
Additionally, how can I retrieve a list with the position of the ones?