Advertisement
Guest User

Untitled

a guest
Jan 8th, 2022
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. Source Code:
  2.  
  3. -----------------------------------
  4.  
  5. surface_n = int(input())
  6. x_land = []
  7. y_land = []
  8. for i in range(surface_n):
  9.  
  10. land_x, land_y = [int(j) for j in input().split()]
  11. x_land.append(land_x)
  12. y_land.append(land_y)
  13.  
  14. data = zip(x_land, y_land)
  15.  
  16. for b in data:
  17. df = pd.DataFrame(data, columns =['x', 'y'])
  18. duplicateDF = df[df.duplicated(subset='y', keep=False)]
  19. print(duplicateDF, file=sys.stderr, flush=True)
  20.  
  21. ------------------------------------------
  22.  
  23. Test 3 Input / Output:
  24. Input:
  25. x y
  26. 0 1000 500
  27. 1 1500 1500
  28. 2 3000 1000
  29. 3 4000 150
  30. 4 5500 150
  31. 5 6999 800
  32.  
  33. Output:
  34. x y
  35. 3 4000 150
  36. 4 5500 150
  37.  
  38. Test 4 Input / Output:
  39.  
  40. Input:
  41. x y
  42. 0 300 1500
  43. 1 350 1400
  44. 2 500 2000
  45. 3 800 1800
  46. 4 1000 2500
  47. 5 1200 2100
  48. 6 1500 2400
  49. 7 2000 1000
  50. 8 2200 500
  51. 9 2500 100
  52. 10 2900 800
  53. 11 3000 500
  54. 12 3200 1000
  55. 13 3500 2000
  56. 14 3800 800
  57. 15 4000 200
  58. 16 5000 200
  59. 17 5500 1500
  60. 18 6999 2800
  61.  
  62. Output:
  63. x y
  64. 0 300 1500
  65. 2 500 2000
  66. 7 2000 1000
  67. 8 2200 500
  68. 10 2900 800
  69. 11 3000 500
  70. 12 3200 1000
  71. 13 3500 2000
  72. 14 3800 800
  73. 15 4000 200
  74. 16 5000 200
  75. 17 5500 1500
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement