mplcursors with seaborn and multiple dataframes

I am trying to use mplcursors when plotting data from multiple pandas DataFrames (or from multiple subsets of a single DataFrame).
I have read the answers of this question and this one, as well as this one, which is somewhat redundent with the first one.
I am able to adapt the code of the documentation on Extracting data and labels from a DataFrame to using seaborn with a single DataFrame, i.e. the following works fine:

Convert x same size 2D numpy arrays to a 2+x column data frame

I have two ndarrays of size (m x n), and two lists of length m and n respectively. I want to convert the two matrices to a dataframe with four columns. The first two columns correspond to the m and n dimensions, and contain the values from the lists. The next two columns should contain the values from the two matrices. In total, the resulting dataframe should have m times n rows.

Remove element from a list based on condition in pandas dataframe

a= {‘A’ : [1, 2,3,4], ‘B’ : [‘FOOTBALL’,’BASKETBALL’,’HANDBALL’,’VOLLEYBALL’], ‘C’ : [[5,10,15,40],[1,4],[20,10,40],[10,40]] } How can I remove the element 40 from C if B is different to FOOTBALL Like this : A B C 0 1 FOOTBALL [5, 10, 15, 40] 1 2 BASKETBALL [1, 4] 2 3 HANDBALL [20, 10] 3 4 VOLLEYBALL [10] Answers: … Read more