I use networkX in python and frozenset as the vertex labeling.
I couldn't find a particular site even though I looked into how to get the elements of frozenset, so I wrote it down here.
I would appreciate it if you could refer to the examples below.
Example
·frozenset([1,2])
What you want to do: Get elements 1 and 2
Trouble: Unable to retrieve elements
There is also an option other than for .Take it out and choose according to how you want to use it.
>>f=frozenset([1,2])
>>f
frozenset ({1,2})
>> list(f)
[1, 2]
>> set(f)
{1, 2}
>>tuple(f)
(1, 2)
Set is out of order, so it cannot be retrieved like a list
Therefore, you must remove it with for.
s=frozenset ([1,2])
for value in:
print(value)//1,2
© 2024 OneMinuteCode. All rights reserved.