Home > other >  Creating a plot with the most occurring combinations of two columns
Creating a plot with the most occurring combinations of two columns

Time:11-01

For showing my data I want to create a frequency plot. This plot will be based on the number of times a combination between two columns occur. I have a two columns in a dataset (df):

acq_cc: [CN, IN, CN, CN, CN, IN, CN, CN, CN, ZA]

tar_cc: [GB, ZA, NO, AR, VG, JP, NL, PK, PK, SG]

The value of the columns needs to be combined e.g. CN - GB, IN - ZA. Afterwards, I want to count how often a combination of occurs. In this situation CN - PK occurs twice.

I used enter image description here

  • Related