How to count repeated values in a column(df1) and add it to a new dataframe(df2) with two modified columns. I tried with drop_duplicates(), value_counts() and assigned to new dataframe but value_counts() showing NaN values . How to convert dataframe from df1 to df2. Thank You.
df1:
A
0 Dell
1 Lenovo
2 Acer
3 Apple
4 Lenovo
5 Dell
df2:
A B
0 Dell 2
1 Lenovo 2
2 Acer 1
3 Apple 1