Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Source Code:
- -----------------------------------
- surface_n = int(input())
- x_land = []
- y_land = []
- for i in range(surface_n):
- land_x, land_y = [int(j) for j in input().split()]
- x_land.append(land_x)
- y_land.append(land_y)
- data = zip(x_land, y_land)
- for b in data:
- df = pd.DataFrame(data, columns =['x', 'y'])
- duplicateDF = df[df.duplicated(subset='y', keep=False)]
- print(duplicateDF, file=sys.stderr, flush=True)
- ------------------------------------------
- Test 3 Input / Output:
- Input:
- x y
- 0 1000 500
- 1 1500 1500
- 2 3000 1000
- 3 4000 150
- 4 5500 150
- 5 6999 800
- Output:
- x y
- 3 4000 150
- 4 5500 150
- Test 4 Input / Output:
- Input:
- x y
- 0 300 1500
- 1 350 1400
- 2 500 2000
- 3 800 1800
- 4 1000 2500
- 5 1200 2100
- 6 1500 2400
- 7 2000 1000
- 8 2200 500
- 9 2500 100
- 10 2900 800
- 11 3000 500
- 12 3200 1000
- 13 3500 2000
- 14 3800 800
- 15 4000 200
- 16 5000 200
- 17 5500 1500
- 18 6999 2800
- Output:
- x y
- 0 300 1500
- 2 500 2000
- 7 2000 1000
- 8 2200 500
- 10 2900 800
- 11 3000 500
- 12 3200 1000
- 13 3500 2000
- 14 3800 800
- 15 4000 200
- 16 5000 200
- 17 5500 1500
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement