I have a dataframe with 47 columns with records of the same type (string). Here is an example with only 3 columns:
d1=
C1 C2 C3 C4
A2 A1 A5
NaN NaN A4
A1 A2 A3
NaN NaN NaN A5
I need to create an output with the frequency of appearance of each text value that is presented in all the columns of the dataframe
For my example the output would be:
S1=
A1 2
A2 2
A3 1
A4 1
A5 2
I appreciate what you can help me with.
A fairly comfortable way is to "flatten" the
dataframe
into andarray
withravel()
to then count the occurrences:Departure: