Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23218

Find intersections in all dataset rows

$
0
0

I need to write a function.

It takes any value from the dataset as input and should look for an intersection in all rows.

For example:phone = 87778885566

The table is represented by the following fields:

  1. key
  2. id
  3. phone
  4. email

Test data:

  • 1; 12345; 89997776655; test@gmail.com
  • 2; 54321; 87778885566; two@gmail.com
  • 3; 98765; 87776664577; three@gmail.com
  • 4; 66678; 87778885566; four@gmail.com
  • 5; 34567; 84547895566; four@gmail.com
  • 6; 34567; 89087545678; five@gmail.com

The output should be:

  • 2; 54321; 87778885566; two@gmail.com
  • 4; 66678; 87778885566;four@gmail.com
  • 5; 34567; 84547895566; four@gmail.com
  • 6; 34567; 89087545678; five@gmail.com

It should check all values ​​and if values ​​intersect somewhere, return a dataset with intersections.


Viewing all articles
Browse latest Browse all 23218

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>