def intersection_by(a, b, fn):
  _b = set(map(fn, b))
  return [item for item in a if fn(item) in _b]

from math import floor

intersection_by([2.1, 1.2], [2.3, 3.4], floor) # [2.1]

 

相关文章:

  • 2021-08-30
  • 2022-01-22
  • 2021-07-28
  • 2022-12-23
  • 2022-12-23
  • 2021-11-28
  • 2021-12-07
猜你喜欢
  • 2021-10-21
  • 2022-01-05
  • 2021-07-17
  • 2022-02-24
  • 2022-12-23
  • 2021-08-03
  • 2022-01-10
相关资源
相似解决方案