Python Forum
Finding nearest point of a Multidigraph in Python 3.7
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Finding nearest point of a Multidigraph in Python 3.7
#6
H = [(1,2), (2,3), (1,3), (3,2), (3,4)]

new_H = {'x': [], 'y': []}
for x, y in H:
    new_H['x'].append(x)
    new_H['y'].append(y)

print(new_H)

# {'x': [1, 2, 1, 3, 3], 'y': [2, 3, 3, 2, 4]}
Reply


Messages In This Thread
RE: Finding nearest point of a Multidigraph in Python 3.7 - by ThomasL - Aug-24-2019, 08:51 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Get numpy ceil and floor value for nearest two decimals klllmmm 4 1,265 Jun-07-2023, 07:35 AM
Last Post: paul18fr
  compare and find the nearest element ? mr_gentle_sausage 4 1,038 Jan-15-2023, 07:11 AM
Last Post: DPaul
  finding point in m grid jenya56 0 816 Feb-06-2022, 09:00 PM
Last Post: jenya56
  Python Matplotlib: How do I plot lines with different end point in the same graph? JaneTan 0 1,577 Feb-28-2021, 11:56 AM
Last Post: JaneTan
  Rounding to the nearest eight wallgraffiti 2 2,072 Jul-15-2020, 06:05 PM
Last Post: wallgraffiti
  Finding Max and Min Values Associated with Unique Identifiers in Python ubk046 1 2,044 May-08-2020, 12:04 PM
Last Post: anbu23
  connecting the first point to the last point Matplotlib omar_mohsen 0 4,588 Jan-15-2020, 01:23 PM
Last Post: omar_mohsen
  finding the closest floating point number in a list Skaperen 17 8,273 Sep-19-2019, 10:39 PM
Last Post: Skaperen
  finding the next higher representable floating point value Skaperen 0 1,940 Sep-13-2019, 11:16 PM
Last Post: Skaperen
  find nearest number d3fi 7 3,940 Aug-26-2019, 09:32 PM
Last Post: ichabod801

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020