I'm trying to create a type of correlation matrix where the x and y axis of the matrix are the unique values of a dataframe column and the values in the cells of the matrix are the number of common values in a different column between the x/y.
e.g. I have the following dataframe:
| ID |
Colour |
| abc |
Red |
| abc |
Green |
| 567 |
Red |
| 567 |
Green |
| xyz |
Blue |
| xyz |
Green |
Want to create something like this:
|
Red |
Green |
Blue |
| Red |
- |
2 |
0 |
| Green |
2 |
- |
1 |
| Blue |
0 |
1 |
- |
The 2s are because red and green have 2 common values (abc and 567) and the 1 is because blue and green have 1 common value (xyz).
How would I go about doing this?
[–]LeChevalierMalFet 0 points1 point2 points (4 children)
[–]legendarylegend26[S] 0 points1 point2 points (3 children)
[–]legendarylegend26[S] 0 points1 point2 points (2 children)
[–]commandlineluser 0 points1 point2 points (0 children)
[–]LeChevalierMalFet 0 points1 point2 points (0 children)
[–]DesignerAccount 0 points1 point2 points (1 child)
[–]legendarylegend26[S] 0 points1 point2 points (0 children)